src/Orleans.Streaming/PubSub/StreamSubscriptionManagerExtensions.cs
/// <summary>
/// Subscribes the specified grain to the specified stream.
/// </summary>
/// <typeparam name="TGrainInterface">An interface which the grain is the primary implementation of.</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="primaryKey">The grain's primary key.</param>
/// <param name="keyExtension">The grain's key extension.</param>
/// <param name="grainClassNamePrefix">The grain class name prefix.</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,
            long primaryKey,
            string keyExtension,
            string grainClassNamePrefix = null)
            where TGrainInterface : IGrainWithIntegerCompoundKey
        {
            var grainRef = grainFactory.GetGrain<TGrainInterface>(primaryKey, keyExtension, grainClassNamePrefix) as GrainReference;
            return manager.AddSubscription(streamProviderName, streamId, grainRef);
        }
public static Task < StreamSubscription > AddSubscription < TGrainInterface > ( this IStreamSubscriptionManager manager , IGrainFactory grainFactory , StreamId streamId , string streamProviderName , long primaryKey , string keyExtension , string grainClassNamePrefix = null ) where TGrainInterface : IGrainWithIntegerCompoundKey { var grainRef = grainFactory . GetGrain < TGrainInterface > ( primaryKey , keyExtension , grainClassNamePrefix ) 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
<not_specific>
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 .
primaryKey
long
The grain's primary key.
The grain ' s primary key .
keyExtension
string
The grain's key extension.
The grain ' s key extension .
grainClassNamePrefix
string
The grain class name prefix.
The grain class name prefix .
manager
<not_specific>
None
typeparam
An interface which the grain is the primary implementation of.
An interface which the grain is the primary implementation of .