Class AsyncObservableExtensions
Inheritance
Namespace: Orleans.Streams
Assembly: Orleans.Core.Abstractions.dll
Syntax
public static class AsyncObservableExtensions : object
Methods
| Improve this Doc View SourceSubscribeAsync<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.
Declaration
public static Task<StreamSubscriptionHandle<T>> SubscribeAsync<T>(this IAsyncObservable<T> obs, Func<T, StreamSequenceToken, Task> onNextAsync)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsyncObservable<T> | obs | The Observable object. |
| Func<T, StreamSequenceToken, Task> | onNextAsync | Delegte that is called for IAsyncObserver.OnNextAsync. |
Returns
| Type | Description |
|---|---|
| Task<StreamSubscriptionHandle<T>> | 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. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of object produced by the observable. |
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.
Declaration
public static Task<StreamSubscriptionHandle<T>> SubscribeAsync<T>(this IAsyncObservable<T> obs, Func<T, StreamSequenceToken, Task> onNextAsync, Func<Exception, Task> onErrorAsync)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsyncObservable<T> | obs | The Observable object. |
| Func<T, StreamSequenceToken, Task> | onNextAsync | Delegte that is called for IAsyncObserver.OnNextAsync. |
| Func<Exception, Task> | onErrorAsync | Delegte that is called for IAsyncObserver.OnErrorAsync. |
Returns
| Type | Description |
|---|---|
| Task<StreamSubscriptionHandle<T>> | 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. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of object produced by the observable. |
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.
Declaration
public static Task<StreamSubscriptionHandle<T>> SubscribeAsync<T>(this IAsyncObservable<T> obs, Func<T, StreamSequenceToken, Task> onNextAsync, Func<Exception, Task> onErrorAsync, Func<Task> onCompletedAsync)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsyncObservable<T> | obs | The Observable object. |
| Func<T, StreamSequenceToken, Task> | onNextAsync | Delegte that is called for IAsyncObserver.OnNextAsync. |
| Func<Exception, Task> | onErrorAsync | Delegte that is called for IAsyncObserver.OnErrorAsync. |
| Func<Task> | onCompletedAsync | Delegte that is called for IAsyncObserver.OnCompletedAsync. |
Returns
| Type | Description |
|---|---|
| Task<StreamSubscriptionHandle<T>> | 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. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of object produced by the observable. |
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.
Declaration
public static Task<StreamSubscriptionHandle<T>> SubscribeAsync<T>(this IAsyncObservable<T> obs, Func<T, StreamSequenceToken, Task> onNextAsync, Func<Exception, Task> onErrorAsync, Func<Task> onCompletedAsync, StreamSequenceToken token, StreamFilterPredicate filterFunc = null, object filterData = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsyncObservable<T> | obs | The Observable object. |
| Func<T, StreamSequenceToken, Task> | onNextAsync | Delegte that is called for IAsyncObserver.OnNextAsync. |
| Func<Exception, Task> | onErrorAsync | Delegte that is called for IAsyncObserver.OnErrorAsync. |
| Func<Task> | onCompletedAsync | Delegte that is called for IAsyncObserver.OnCompletedAsync. |
| StreamSequenceToken | token | The stream sequence to be used as an offset to start the subscription from. |
| StreamFilterPredicate | filterFunc | Filter to be applied for this subscription |
| System.Object | filterData | 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
| Type | Description |
|---|---|
| Task<StreamSubscriptionHandle<T>> | 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. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of object produced by the observable. |
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.
Declaration
public static Task<StreamSubscriptionHandle<T>> SubscribeAsync<T>(this IAsyncObservable<T> obs, Func<T, StreamSequenceToken, Task> onNextAsync, Func<Exception, Task> onErrorAsync, StreamSequenceToken token, StreamFilterPredicate filterFunc = null, object filterData = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsyncObservable<T> | obs | The Observable object. |
| Func<T, StreamSequenceToken, Task> | onNextAsync | Delegte that is called for IAsyncObserver.OnNextAsync. |
| Func<Exception, Task> | onErrorAsync | Delegte that is called for IAsyncObserver.OnErrorAsync. |
| StreamSequenceToken | token | The stream sequence to be used as an offset to start the subscription from. |
| StreamFilterPredicate | filterFunc | Filter to be applied for this subscription |
| System.Object | filterData | 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
| Type | Description |
|---|---|
| Task<StreamSubscriptionHandle<T>> | 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. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of object produced by the observable. |
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.
Declaration
public static Task<StreamSubscriptionHandle<T>> SubscribeAsync<T>(this IAsyncObservable<T> obs, Func<T, StreamSequenceToken, Task> onNextAsync, Func<Task> onCompletedAsync)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsyncObservable<T> | obs | The Observable object. |
| Func<T, StreamSequenceToken, Task> | onNextAsync | Delegte that is called for IAsyncObserver.OnNextAsync. |
| Func<Task> | onCompletedAsync | Delegte that is called for IAsyncObserver.OnCompletedAsync. |
Returns
| Type | Description |
|---|---|
| Task<StreamSubscriptionHandle<T>> | 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. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of object produced by the observable. |
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.
Declaration
public static Task<StreamSubscriptionHandle<T>> SubscribeAsync<T>(this IAsyncObservable<T> obs, Func<T, StreamSequenceToken, Task> onNextAsync, Func<Task> onCompletedAsync, StreamSequenceToken token, StreamFilterPredicate filterFunc = null, object filterData = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsyncObservable<T> | obs | The Observable object. |
| Func<T, StreamSequenceToken, Task> | onNextAsync | Delegte that is called for IAsyncObserver.OnNextAsync. |
| Func<Task> | onCompletedAsync | Delegte that is called for IAsyncObserver.OnCompletedAsync. |
| StreamSequenceToken | token | The stream sequence to be used as an offset to start the subscription from. |
| StreamFilterPredicate | filterFunc | Filter to be applied for this subscription |
| System.Object | filterData | 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
| Type | Description |
|---|---|
| Task<StreamSubscriptionHandle<T>> | 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. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of object produced by the observable. |
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.
Declaration
public static Task<StreamSubscriptionHandle<T>> SubscribeAsync<T>(this IAsyncObservable<T> obs, Func<T, StreamSequenceToken, Task> onNextAsync, StreamSequenceToken token, StreamFilterPredicate filterFunc = null, object filterData = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IAsyncObservable<T> | obs | The Observable object. |
| Func<T, StreamSequenceToken, Task> | onNextAsync | Delegte that is called for IAsyncObserver.OnNextAsync. |
| StreamSequenceToken | token | The stream sequence to be used as an offset to start the subscription from. |
| StreamFilterPredicate | filterFunc | Filter to be applied for this subscription |
| System.Object | filterData | 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
| Type | Description |
|---|---|
| Task<StreamSubscriptionHandle<T>> | 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. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of object produced by the observable. |