ArcGIS Pro 2.7 API Reference Guide
RealtimeDatastore Constructor
Example 

ArcGIS.Core.Data.Realtime Namespace > RealtimeDatastore Class : RealtimeDatastore Constructor
A valid RealtimeServiceConnectionProperties object which has the URI to a real-time service such as stream service. In case the service is not a public, the username and password properties are also expected to be set.
Opens a real-time datastore with a RealtimeServiceConnectionProperties. This method must be called on the MCT. Use QueuedTask.Run.
Syntax

Parameters

connectionProperties
A valid RealtimeServiceConnectionProperties object which has the URI to a real-time service such as stream service. In case the service is not a public, the username and password properties are also expected to be set.
Exceptions
ExceptionDescription
The information used to connect to the a real-time service is invalid.
The URL is not provided.
This method or property must be called within the lambda passed to QueuedTask.Run.
connectionProperties
Represents a geodatabase not found or not opened exception.
Example
Open a RealtimeDatastore and retrieve a RealtimeFeatureClass from there.
var url = "https://geoeventsample1.esri.com:6443/arcgis/rest/services/AirportTraffics/StreamServer";
     
await QueuedTask.Run(() =>
{
  var realtimeServiceConProp = new RealtimeServiceConnectionProperties(
                                   new Uri(url),
                                   RealtimeDatastoreType.StreamService
                                );
  using (var realtimeDatastore = new RealtimeDatastore(realtimeServiceConProp))
  {
    //A Realtime data store only contains **one** Realtime feature class (or table)
    var name = realtimeDatastore.GetTableNames().First();
    using (var realtimeFeatureClass = realtimeDatastore.OpenTable(name) as RealtimeFeatureClass)
    {
      //feature class, by default, is not streaming (opposite of the stream layer)
      realtimeFeatureClass.StartStreaming();
      //TODO use the feature class
      //...
    }
  }

});
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

RealtimeDatastore Class
RealtimeDatastore Members