Class StreamSubscriptionHandleExtensions
Inheritance
Namespace: Orleans.Streams
Assembly: Orleans.Core.Abstractions.dll
Syntax
public static class StreamSubscriptionHandleExtensions : object
Methods
| Improve this Doc View SourceResumeAsync<T>(StreamSubscriptionHandle<T>, Func<T, StreamSequenceToken, Task>, Func<Exception, Task>, Func<Task>, StreamSequenceToken)
Resumes consumption of a stream using delegates. This method is a helper for the StreamSubscriptionHandle.ResumeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver.
Declaration
public static Task<StreamSubscriptionHandle<T>> ResumeAsync<T>(this StreamSubscriptionHandle<T> handle, Func<T, StreamSequenceToken, Task> onNextAsync, Func<Exception, Task> onErrorAsync, Func<Task> onCompletedAsync, StreamSequenceToken token = null)
Parameters
| Type | Name | Description |
|---|---|---|
| StreamSubscriptionHandle<T> | handle | The subscription handle. |
| 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. |
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. |
ResumeAsync<T>(StreamSubscriptionHandle<T>, Func<T, StreamSequenceToken, Task>, Func<Exception, Task>, StreamSequenceToken)
Resumes consumption of a stream using delegates. This method is a helper for the StreamSubscriptionHandle.ResumeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver.
Declaration
public static Task<StreamSubscriptionHandle<T>> ResumeAsync<T>(this StreamSubscriptionHandle<T> handle, Func<T, StreamSequenceToken, Task> onNextAsync, Func<Exception, Task> onErrorAsync, StreamSequenceToken token = null)
Parameters
| Type | Name | Description |
|---|---|---|
| StreamSubscriptionHandle<T> | handle | The subscription handle. |
| 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. |
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. |
ResumeAsync<T>(StreamSubscriptionHandle<T>, Func<T, StreamSequenceToken, Task>, Func<Task>, StreamSequenceToken)
Resumes consumption of a stream using delegates. This method is a helper for the StreamSubscriptionHandle.ResumeAsync allowing the subscribing class to inline the handler methods instead of requiring an instance of IAsyncObserver.
Declaration
public static Task<StreamSubscriptionHandle<T>> ResumeAsync<T>(this StreamSubscriptionHandle<T> handle, Func<T, StreamSequenceToken, Task> onNextAsync, Func<Task> onCompletedAsync, StreamSequenceToken token = null)
Parameters
| Type | Name | Description |
|---|---|---|
| StreamSubscriptionHandle<T> | handle | The subscription handle. |
| 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. |
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. |
ResumeAsync<T>(StreamSubscriptionHandle<T>, Func<T, StreamSequenceToken, Task>, StreamSequenceToken)
Declaration
public static Task<StreamSubscriptionHandle<T>> ResumeAsync<T>(this StreamSubscriptionHandle<T> handle, Func<T, StreamSequenceToken, Task> onNextAsync, StreamSequenceToken token = null)
Parameters
| Type | Name | Description |
|---|---|---|
| StreamSubscriptionHandle<T> | handle | The subscription handle. |
| 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. |
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. |