src/Orleans.Streaming/PubSub/StreamSubscriptionManagerExtensions.cs
/// <summary>
/// Subscribes the specified grain to the specified stream.
/// </summary>
/// <typeparam name="TGrainInterface">The grain interface type.</typeparam>
/// <param name="manager">The manager.</param>
/// <param name="grainFactory">The grain factory.</param>
/// <param name="streamId">The stream identifier.</param>
/// <param name="streamProviderName">Name of the stream provider.</param>
/// <param name="grainId">The grain to subscribe.</param>
/// <returns>The newly added subscription.</returns>
Subscribes the specified grain to the specified stream.
Subscribes the specified grain to the specified stream .
public static Task<StreamSubscription> AddSubscription<TGrainInterface>(
            this IStreamSubscriptionManager manager,
            IGrainFactory grainFactory,
            StreamId streamId,
            string streamProviderName,
            GrainId grainId)
            where TGrainInterface : IGrainWithGuidKey
        {
            var grainRef = grainFactory.GetGrain(grainId) as GrainReference;
            return manager.AddSubscription(streamProviderName, streamId, grainRef);
        }
public static Task < StreamSubscription > AddSubscription < TGrainInterface > ( this IStreamSubscriptionManager manager , IGrainFactory grainFactory , StreamId streamId , string streamProviderName , GrainId grainId ) where TGrainInterface : IGrainWithGuidKey { var grainRef = grainFactory . GetGrain ( grainId ) as GrainReference ; return manager . AddSubscription ( streamProviderName , streamId , grainRef ) ; }
Subscribes the specified grain to the specified stream.
Subscribes the specified grain to the specified stream .
The newly added subscription.
The newly added subscription .
IStreamSubscriptionManager
this
grainFactory
IGrainFactory
The grain factory.
The grain factory .
streamId
StreamId
The stream identifier.
The stream identifier .
streamProviderName
string
Name of the stream provider.
Name of the stream provider .
grainId
GrainId
The grain to subscribe.
The grain to subscribe .
manager
None
typeparam
The grain interface type.
The grain interface type .