ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data.Realtime Namespace / RealtimeFeatureClass Class / StartStreaming Method
Example

In This Topic
    StartStreaming Method (RealtimeFeatureClass)
    In This Topic
    Sets the feature class to a state where it starts listening to broadcasts from a real-time service This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Sub StartStreaming() 
    public void StartStreaming()
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Remarks
    When you create a RealtimeFeatureClass, it does not start listening by default. You need to call this function explicitly.
    Example
    Connect to a real-time feature class from a real-time datastore
    {
      var url = "https://geoeventsample1.esri.com:6443/arcgis/rest/services/AirportTraffics/StreamServer";
    
      // Note: call within 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 (RealtimeFeatureClass 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 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also