Edit

Share via


IAsyncObservable<T>.SubscribeAsync Method

Definition

Overloads

SubscribeAsync(IAsyncObserver<T>)

Subscribe a consumer to this observable.

SubscribeAsync(IAsyncObserver<T>, StreamSequenceToken, String)

Subscribe a consumer to this observable.

SubscribeAsync(IAsyncObserver<T>, StreamSequenceToken, StreamFilterPredicate, Object)

Subscribe a consumer to this observable.

SubscribeAsync(IAsyncObserver<T>)

Source:
IAsyncObservable.cs

Subscribe a consumer to this observable.

public System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<T>> SubscribeAsync (Orleans.Streams.IAsyncObserver<T> observer);
abstract member SubscribeAsync : Orleans.Streams.IAsyncObserver<'T> -> System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<'T>>
Public Function SubscribeAsync (observer As IAsyncObserver(Of T)) As Task(Of StreamSubscriptionHandle(Of T))

Parameters

observer
IAsyncObserver<T>

The asynchronous observer to subscribe.

Returns

A promise for a StreamSubscriptionHandle that represents the subscription. The consumer may unsubscribe by using this handle. The subscription remains active for as long as it is not explicitly unsubscribed.

Applies to

SubscribeAsync(IAsyncObserver<T>, StreamSequenceToken, String)

Subscribe a consumer to this observable.

public System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<T>> SubscribeAsync (Orleans.Streams.IAsyncObserver<T> observer, Orleans.Streams.StreamSequenceToken? token, string? filterData = default);
abstract member SubscribeAsync : Orleans.Streams.IAsyncObserver<'T> * Orleans.Streams.StreamSequenceToken * string -> System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<'T>>
Public Function SubscribeAsync (observer As IAsyncObserver(Of T), token As StreamSequenceToken, Optional filterData As String = Nothing) As Task(Of StreamSubscriptionHandle(Of T))

Parameters

observer
IAsyncObserver<T>

The asynchronous observer to subscribe.

token
StreamSequenceToken

The stream sequence to be used as an offset to start the subscription from.

filterData
String

Data object that will be passed in to the filter.

Returns

A promise for a StreamSubscriptionHandle that represents the subscription. The consumer may unsubscribe by using this handle. The subscription remains active for as long as it is not explicitly unsubscribed.

Applies to

SubscribeAsync(IAsyncObserver<T>, StreamSequenceToken, StreamFilterPredicate, Object)

Source:
IAsyncObservable.cs

Subscribe a consumer to this observable.

public System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<T>> SubscribeAsync (Orleans.Streams.IAsyncObserver<T> observer, Orleans.Streams.StreamSequenceToken token, Orleans.Streams.StreamFilterPredicate filterFunc = default, object filterData = default);
abstract member SubscribeAsync : Orleans.Streams.IAsyncObserver<'T> * Orleans.Streams.StreamSequenceToken * Orleans.Streams.StreamFilterPredicate * obj -> System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<'T>>
Public Function SubscribeAsync (observer As IAsyncObserver(Of T), token As StreamSequenceToken, Optional filterFunc As StreamFilterPredicate = Nothing, Optional filterData As Object = Nothing) As Task(Of StreamSubscriptionHandle(Of T))

Parameters

observer
IAsyncObserver<T>

The asynchronous observer to subscribe.

token
StreamSequenceToken

The stream sequence to be used as an offset to start the subscription from.

filterFunc
StreamFilterPredicate

Filter to be applied for this subscription

filterData
Object

Data object that will be passed in to the filterFunc. This will usually contain any paramaters required by the filterFunc to make it's filtering decision.

Returns

A promise for a StreamSubscriptionHandle that represents the subscription. The consumer may unsubscribe by using this handle. The subscription remains active for as long as it is not explicitely unsubscribed.

Exceptions

Thrown if the supplied stream filter function is not suitable. Usually this is because it is not a static method.

Applies to