AsyncObservableExtensions.SubscribeAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>) |
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver. |
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, StreamSequenceToken) |
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver. |
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, Func<Exception,Task>) |
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver. |
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, Func<Task>) |
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver. |
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, Func<Exception,Task>, StreamSequenceToken) |
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver. |
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, Func<Exception,Task>, Func<Task>) |
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver. |
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, Func<Task>, StreamSequenceToken) |
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver. |
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, StreamSequenceToken, StreamFilterPredicate, Object) |
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver. |
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, Func<Exception,Task>, Func<Task>, StreamSequenceToken) |
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver. |
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, Func<Exception,Task>, StreamSequenceToken, StreamFilterPredicate, Object) |
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver. |
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, Func<Task>, StreamSequenceToken, StreamFilterPredicate, Object) |
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver. |
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken, Task>, Func<Exception,Task>, Func<Task>, StreamSequenceToken, StreamFilterPredicate, Object) |
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver. |
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>)
- Source:
- AsyncObservableExtensions.cs
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver.
public static System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<T>> SubscribeAsync<T> (this Orleans.Streams.IAsyncObservable<T> obs, Func<T,Orleans.Streams.StreamSequenceToken,System.Threading.Tasks.Task> onNextAsync);
static member SubscribeAsync : Orleans.Streams.IAsyncObservable<'T> * Func<'T, Orleans.Streams.StreamSequenceToken, System.Threading.Tasks.Task> -> System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<'T>>
<Extension()>
Public Function SubscribeAsync(Of T) (obs As IAsyncObservable(Of T), onNextAsync As Func(Of T, StreamSequenceToken, Task)) As Task(Of StreamSubscriptionHandle(Of T))
Type Parameters
- T
The type of object produced by the observable.
Parameters
The Observable object.
- onNextAsync
- Func<T,StreamSequenceToken,Task>
Delegate that is called for IAsyncObserver.OnNextAsync.
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<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, StreamSequenceToken)
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver.
public static System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<T>> SubscribeAsync<T> (this Orleans.Streams.IAsyncObservable<T> obs, Func<T,Orleans.Streams.StreamSequenceToken,System.Threading.Tasks.Task> onNextAsync, Orleans.Streams.StreamSequenceToken token);
static member SubscribeAsync : Orleans.Streams.IAsyncObservable<'T> * Func<'T, Orleans.Streams.StreamSequenceToken, System.Threading.Tasks.Task> * Orleans.Streams.StreamSequenceToken -> System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<'T>>
<Extension()>
Public Function SubscribeAsync(Of T) (obs As IAsyncObservable(Of T), onNextAsync As Func(Of T, StreamSequenceToken, Task), token As StreamSequenceToken) As Task(Of StreamSubscriptionHandle(Of T))
Type Parameters
- T
The type of object produced by the observable.
Parameters
The Observable object.
- onNextAsync
- Func<T,StreamSequenceToken,Task>
Delegate that is called for IAsyncObserver.OnNextAsync.
- token
- StreamSequenceToken
The stream sequence to be used as an offset to start the subscription from.
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.
Exceptions
Thrown if the supplied stream filter function is not suitable. Usually this is because it is not a static method.
Applies to
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, Func<Exception,Task>)
- Source:
- AsyncObservableExtensions.cs
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver.
public static System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<T>> SubscribeAsync<T> (this Orleans.Streams.IAsyncObservable<T> obs, Func<T,Orleans.Streams.StreamSequenceToken,System.Threading.Tasks.Task> onNextAsync, Func<Exception,System.Threading.Tasks.Task> onErrorAsync);
static member SubscribeAsync : Orleans.Streams.IAsyncObservable<'T> * Func<'T, Orleans.Streams.StreamSequenceToken, System.Threading.Tasks.Task> * Func<Exception, System.Threading.Tasks.Task> -> System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<'T>>
<Extension()>
Public Function SubscribeAsync(Of T) (obs As IAsyncObservable(Of T), onNextAsync As Func(Of T, StreamSequenceToken, Task), onErrorAsync As Func(Of Exception, Task)) As Task(Of StreamSubscriptionHandle(Of T))
Type Parameters
- T
The type of object produced by the observable.
Parameters
The Observable object.
- onNextAsync
- Func<T,StreamSequenceToken,Task>
Delegate that is called for IAsyncObserver.OnNextAsync.
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<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, Func<Task>)
- Source:
- AsyncObservableExtensions.cs
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver.
public static System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<T>> SubscribeAsync<T> (this Orleans.Streams.IAsyncObservable<T> obs, Func<T,Orleans.Streams.StreamSequenceToken,System.Threading.Tasks.Task> onNextAsync, Func<System.Threading.Tasks.Task> onCompletedAsync);
static member SubscribeAsync : Orleans.Streams.IAsyncObservable<'T> * Func<'T, Orleans.Streams.StreamSequenceToken, System.Threading.Tasks.Task> * Func<System.Threading.Tasks.Task> -> System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<'T>>
<Extension()>
Public Function SubscribeAsync(Of T) (obs As IAsyncObservable(Of T), onNextAsync As Func(Of T, StreamSequenceToken, Task), onCompletedAsync As Func(Of Task)) As Task(Of StreamSubscriptionHandle(Of T))
Type Parameters
- T
The type of object produced by the observable.
Parameters
The Observable object.
- onNextAsync
- Func<T,StreamSequenceToken,Task>
Delegate that is called for IAsyncObserver.OnNextAsync.
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<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, Func<Exception,Task>, StreamSequenceToken)
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver.
public static System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<T>> SubscribeAsync<T> (this Orleans.Streams.IAsyncObservable<T> obs, Func<T,Orleans.Streams.StreamSequenceToken,System.Threading.Tasks.Task> onNextAsync, Func<Exception,System.Threading.Tasks.Task> onErrorAsync, Orleans.Streams.StreamSequenceToken token);
static member SubscribeAsync : Orleans.Streams.IAsyncObservable<'T> * Func<'T, Orleans.Streams.StreamSequenceToken, System.Threading.Tasks.Task> * Func<Exception, System.Threading.Tasks.Task> * Orleans.Streams.StreamSequenceToken -> System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<'T>>
<Extension()>
Public Function SubscribeAsync(Of T) (obs As IAsyncObservable(Of T), onNextAsync As Func(Of T, StreamSequenceToken, Task), onErrorAsync As Func(Of Exception, Task), token As StreamSequenceToken) As Task(Of StreamSubscriptionHandle(Of T))
Type Parameters
- T
The type of object produced by the observable.
Parameters
The Observable object.
- onNextAsync
- Func<T,StreamSequenceToken,Task>
Delegate that is called for IAsyncObserver.OnNextAsync.
- token
- StreamSequenceToken
The stream sequence to be used as an offset to start the subscription from.
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.
Exceptions
Thrown if the supplied stream filter function is not suitable. Usually this is because it is not a static method.
Applies to
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, Func<Exception,Task>, Func<Task>)
- Source:
- AsyncObservableExtensions.cs
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver.
public static System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<T>> SubscribeAsync<T> (this Orleans.Streams.IAsyncObservable<T> obs, Func<T,Orleans.Streams.StreamSequenceToken,System.Threading.Tasks.Task> onNextAsync, Func<Exception,System.Threading.Tasks.Task> onErrorAsync, Func<System.Threading.Tasks.Task> onCompletedAsync);
static member SubscribeAsync : Orleans.Streams.IAsyncObservable<'T> * Func<'T, Orleans.Streams.StreamSequenceToken, System.Threading.Tasks.Task> * Func<Exception, System.Threading.Tasks.Task> * Func<System.Threading.Tasks.Task> -> System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<'T>>
<Extension()>
Public Function SubscribeAsync(Of T) (obs As IAsyncObservable(Of T), onNextAsync As Func(Of T, StreamSequenceToken, Task), onErrorAsync As Func(Of Exception, Task), onCompletedAsync As Func(Of Task)) As Task(Of StreamSubscriptionHandle(Of T))
Type Parameters
- T
The type of object produced by the observable.
Parameters
The Observable object.
- onNextAsync
- Func<T,StreamSequenceToken,Task>
Delegate that is called for IAsyncObserver.OnNextAsync.
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<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, Func<Task>, StreamSequenceToken)
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver.
public static System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<T>> SubscribeAsync<T> (this Orleans.Streams.IAsyncObservable<T> obs, Func<T,Orleans.Streams.StreamSequenceToken,System.Threading.Tasks.Task> onNextAsync, Func<System.Threading.Tasks.Task> onCompletedAsync, Orleans.Streams.StreamSequenceToken token);
static member SubscribeAsync : Orleans.Streams.IAsyncObservable<'T> * Func<'T, Orleans.Streams.StreamSequenceToken, System.Threading.Tasks.Task> * Func<System.Threading.Tasks.Task> * Orleans.Streams.StreamSequenceToken -> System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<'T>>
<Extension()>
Public Function SubscribeAsync(Of T) (obs As IAsyncObservable(Of T), onNextAsync As Func(Of T, StreamSequenceToken, Task), onCompletedAsync As Func(Of Task), token As StreamSequenceToken) As Task(Of StreamSubscriptionHandle(Of T))
Type Parameters
- T
The type of object produced by the observable.
Parameters
The Observable object.
- onNextAsync
- Func<T,StreamSequenceToken,Task>
Delegate that is called for IAsyncObserver.OnNextAsync.
- token
- StreamSequenceToken
The stream sequence to be used as an offset to start the subscription from.
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.
Exceptions
Thrown if the supplied stream filter function is not suitable. Usually this is because it is not a static method.
Applies to
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, StreamSequenceToken, StreamFilterPredicate, Object)
- Source:
- AsyncObservableExtensions.cs
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver.
public static System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<T>> SubscribeAsync<T> (this Orleans.Streams.IAsyncObservable<T> obs, Func<T,Orleans.Streams.StreamSequenceToken,System.Threading.Tasks.Task> onNextAsync, Orleans.Streams.StreamSequenceToken token, Orleans.Streams.StreamFilterPredicate filterFunc = default, object filterData = default);
static member SubscribeAsync : Orleans.Streams.IAsyncObservable<'T> * Func<'T, Orleans.Streams.StreamSequenceToken, System.Threading.Tasks.Task> * Orleans.Streams.StreamSequenceToken * Orleans.Streams.StreamFilterPredicate * obj -> System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<'T>>
<Extension()>
Public Function SubscribeAsync(Of T) (obs As IAsyncObservable(Of T), onNextAsync As Func(Of T, StreamSequenceToken, Task), token As StreamSequenceToken, Optional filterFunc As StreamFilterPredicate = Nothing, Optional filterData As Object = Nothing) As Task(Of StreamSubscriptionHandle(Of T))
Type Parameters
- T
The type of object produced by the observable.
Parameters
The Observable object.
- onNextAsync
- Func<T,StreamSequenceToken,Task>
Delegte that is called for IAsyncObserver.OnNextAsync.
- 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
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, Func<Exception,Task>, Func<Task>, StreamSequenceToken)
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver.
public static System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<T>> SubscribeAsync<T> (this Orleans.Streams.IAsyncObservable<T> obs, Func<T,Orleans.Streams.StreamSequenceToken,System.Threading.Tasks.Task> onNextAsync, Func<Exception,System.Threading.Tasks.Task> onErrorAsync, Func<System.Threading.Tasks.Task> onCompletedAsync, Orleans.Streams.StreamSequenceToken token);
static member SubscribeAsync : Orleans.Streams.IAsyncObservable<'T> * Func<'T, Orleans.Streams.StreamSequenceToken, System.Threading.Tasks.Task> * Func<Exception, System.Threading.Tasks.Task> * Func<System.Threading.Tasks.Task> * Orleans.Streams.StreamSequenceToken -> System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<'T>>
<Extension()>
Public Function SubscribeAsync(Of T) (obs As IAsyncObservable(Of T), onNextAsync As Func(Of T, StreamSequenceToken, Task), onErrorAsync As Func(Of Exception, Task), onCompletedAsync As Func(Of Task), token As StreamSequenceToken) As Task(Of StreamSubscriptionHandle(Of T))
Type Parameters
- T
The type of object produced by the observable.
Parameters
The Observable object.
- onNextAsync
- Func<T,StreamSequenceToken,Task>
Delegate that is called for IAsyncObserver.OnNextAsync.
- token
- StreamSequenceToken
The stream sequence to be used as an offset to start the subscription from.
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.
Exceptions
Thrown if the supplied stream filter function is not suitable. Usually this is because it is not a static method.
Applies to
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, Func<Exception,Task>, StreamSequenceToken, StreamFilterPredicate, Object)
- Source:
- AsyncObservableExtensions.cs
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver.
public static System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<T>> SubscribeAsync<T> (this Orleans.Streams.IAsyncObservable<T> obs, Func<T,Orleans.Streams.StreamSequenceToken,System.Threading.Tasks.Task> onNextAsync, Func<Exception,System.Threading.Tasks.Task> onErrorAsync, Orleans.Streams.StreamSequenceToken token, Orleans.Streams.StreamFilterPredicate filterFunc = default, object filterData = default);
static member SubscribeAsync : Orleans.Streams.IAsyncObservable<'T> * Func<'T, Orleans.Streams.StreamSequenceToken, System.Threading.Tasks.Task> * Func<Exception, System.Threading.Tasks.Task> * Orleans.Streams.StreamSequenceToken * Orleans.Streams.StreamFilterPredicate * obj -> System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<'T>>
<Extension()>
Public Function SubscribeAsync(Of T) (obs As IAsyncObservable(Of T), onNextAsync As Func(Of T, StreamSequenceToken, Task), onErrorAsync As Func(Of Exception, Task), token As StreamSequenceToken, Optional filterFunc As StreamFilterPredicate = Nothing, Optional filterData As Object = Nothing) As Task(Of StreamSubscriptionHandle(Of T))
Type Parameters
- T
The type of object produced by the observable.
Parameters
The Observable object.
- onNextAsync
- Func<T,StreamSequenceToken,Task>
Delegte that is called for IAsyncObserver.OnNextAsync.
- 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
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken,Task>, Func<Task>, StreamSequenceToken, StreamFilterPredicate, Object)
- Source:
- AsyncObservableExtensions.cs
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver.
public static System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<T>> SubscribeAsync<T> (this Orleans.Streams.IAsyncObservable<T> obs, Func<T,Orleans.Streams.StreamSequenceToken,System.Threading.Tasks.Task> onNextAsync, Func<System.Threading.Tasks.Task> onCompletedAsync, Orleans.Streams.StreamSequenceToken token, Orleans.Streams.StreamFilterPredicate filterFunc = default, object filterData = default);
static member SubscribeAsync : Orleans.Streams.IAsyncObservable<'T> * Func<'T, Orleans.Streams.StreamSequenceToken, System.Threading.Tasks.Task> * Func<System.Threading.Tasks.Task> * Orleans.Streams.StreamSequenceToken * Orleans.Streams.StreamFilterPredicate * obj -> System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<'T>>
<Extension()>
Public Function SubscribeAsync(Of T) (obs As IAsyncObservable(Of T), onNextAsync As Func(Of T, StreamSequenceToken, Task), onCompletedAsync As Func(Of Task), token As StreamSequenceToken, Optional filterFunc As StreamFilterPredicate = Nothing, Optional filterData As Object = Nothing) As Task(Of StreamSubscriptionHandle(Of T))
Type Parameters
- T
The type of object produced by the observable.
Parameters
The Observable object.
- onNextAsync
- Func<T,StreamSequenceToken,Task>
Delegte that is called for IAsyncObserver.OnNextAsync.
- 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
SubscribeAsync<T>(IAsyncObservable<T>, Func<T,StreamSequenceToken, Task>, Func<Exception,Task>, Func<Task>, StreamSequenceToken, StreamFilterPredicate, Object)
- Source:
- AsyncObservableExtensions.cs
Subscribe a consumer to this observable using delegates. This method is a helper for the IAsyncObservable.SubscribeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver.
public static System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<T>> SubscribeAsync<T> (this Orleans.Streams.IAsyncObservable<T> obs, Func<T,Orleans.Streams.StreamSequenceToken,System.Threading.Tasks.Task> onNextAsync, Func<Exception,System.Threading.Tasks.Task> onErrorAsync, Func<System.Threading.Tasks.Task> onCompletedAsync, Orleans.Streams.StreamSequenceToken token, Orleans.Streams.StreamFilterPredicate filterFunc = default, object filterData = default);
static member SubscribeAsync : Orleans.Streams.IAsyncObservable<'T> * Func<'T, Orleans.Streams.StreamSequenceToken, System.Threading.Tasks.Task> * Func<Exception, System.Threading.Tasks.Task> * Func<System.Threading.Tasks.Task> * Orleans.Streams.StreamSequenceToken * Orleans.Streams.StreamFilterPredicate * obj -> System.Threading.Tasks.Task<Orleans.Streams.StreamSubscriptionHandle<'T>>
<Extension()>
Public Function SubscribeAsync(Of T) (obs As IAsyncObservable(Of T), onNextAsync As Func(Of T, StreamSequenceToken, Task), onErrorAsync As Func(Of Exception, Task), onCompletedAsync As Func(Of Task), token As StreamSequenceToken, Optional filterFunc As StreamFilterPredicate = Nothing, Optional filterData As Object = Nothing) As Task(Of StreamSubscriptionHandle(Of T))
Type Parameters
- T
The type of object produced by the observable.
Parameters
The Observable object.
- onNextAsync
- Func<T,StreamSequenceToken,Task>
Delegte that is called for IAsyncObserver.OnNextAsync.
- 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.