Skip to content

StreamSubscriptionHandleExtensions Methods

Extension methods for Orleans.Streams.StreamSubscriptionHandle.

ResumeAsync(StreamSubscriptionHandle<T>, Func<IList<SequentialItem<T>>, Task>, Func<Exception, Task>, Func<Task>, StreamSequenceToken)

staticextension
View source
public static Task<StreamSubscriptionHandle<T>> ResumeAsync<T>(this StreamSubscriptionHandle<T> handle, Func<IList<SequentialItem<T>>, Task> onNextAsync, Func<Exception, Task> onErrorAsync, Func<Task> onCompletedAsync, StreamSequenceToken token = null)
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 IAsyncBatchObserver.

Parameters

handleStreamSubscriptionHandle<T>
The subscription handle.
onNextAsyncFunc<IList<SequentialItem<T>>, Task>
Delegate that is called for IAsyncObserver.OnNextAsync.
onErrorAsyncFunc<Exception, Task>
Delegate that is called for IAsyncObserver.OnErrorAsync.
onCompletedAsyncFunc<Task>
Delegate that is called for IAsyncObserver.OnCompletedAsync.
tokenStreamSequenceToken
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.

ResumeAsync(StreamSubscriptionHandle<T>, Func<IList<SequentialItem<T>>, Task>, Func<Exception, Task>, StreamSequenceToken)

staticextension
View source
public static Task<StreamSubscriptionHandle<T>> ResumeAsync<T>(this StreamSubscriptionHandle<T> handle, Func<IList<SequentialItem<T>>, Task> onNextAsync, Func<Exception, Task> onErrorAsync, StreamSequenceToken token = null)
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 IAsyncBatchObserver.

Parameters

handleStreamSubscriptionHandle<T>
The subscription handle.
onNextAsyncFunc<IList<SequentialItem<T>>, Task>
Delegate that is called for IAsyncObserver.OnNextAsync.
onErrorAsyncFunc<Exception, Task>
Delegate that is called for IAsyncObserver.OnErrorAsync.
tokenStreamSequenceToken
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.

ResumeAsync(StreamSubscriptionHandle<T>, Func<IList<SequentialItem<T>>, Task>, Func<Task>, StreamSequenceToken)

staticextension
View source
public static Task<StreamSubscriptionHandle<T>> ResumeAsync<T>(this StreamSubscriptionHandle<T> handle, Func<IList<SequentialItem<T>>, Task> onNextAsync, Func<Task> onCompletedAsync, StreamSequenceToken token = null)
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 IAsyncBatchObserver.

Parameters

handleStreamSubscriptionHandle<T>
The subscription handle.
onNextAsyncFunc<IList<SequentialItem<T>>, Task>
Delegate that is called for IAsyncObserver.OnNextAsync.
onCompletedAsyncFunc<Task>
Delegate that is called for IAsyncObserver.OnCompletedAsync.
tokenStreamSequenceToken
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.

ResumeAsync(StreamSubscriptionHandle<T>, Func<IList<SequentialItem<T>>, Task>, StreamSequenceToken)

staticextension
View source
public static Task<StreamSubscriptionHandle<T>> ResumeAsync<T>(this StreamSubscriptionHandle<T> handle, Func<IList<SequentialItem<T>>, Task> onNextAsync, StreamSequenceToken token = null)
Thrown if the supplied stream filter function is not suitable. Usually this is because it is not a static method.

Parameters

handleStreamSubscriptionHandle<T>
The subscription handle.
onNextAsyncFunc<IList<SequentialItem<T>>, Task>
Delegate that is called for IAsyncObserver.OnNextAsync.
tokenStreamSequenceToken
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.

ResumeAsync(StreamSubscriptionHandle<T>, Func<T, StreamSequenceToken, Task>, Func<Exception, Task>, Func<Task>, StreamSequenceToken)

staticextension
View source
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)
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.

Parameters

handleStreamSubscriptionHandle<T>
The subscription handle.
onNextAsyncFunc<T, StreamSequenceToken, Task>
Delegate that is called for IAsyncObserver.OnNextAsync.
onErrorAsyncFunc<Exception, Task>
Delegate that is called for IAsyncObserver.OnErrorAsync.
onCompletedAsyncFunc<Task>
Delegate that is called for IAsyncObserver.OnCompletedAsync.
tokenStreamSequenceToken
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.

ResumeAsync(StreamSubscriptionHandle<T>, Func<T, StreamSequenceToken, Task>, Func<Exception, Task>, StreamSequenceToken)

staticextension
View source
public static Task<StreamSubscriptionHandle<T>> ResumeAsync<T>(this StreamSubscriptionHandle<T> handle, Func<T, StreamSequenceToken, Task> onNextAsync, Func<Exception, Task> onErrorAsync, StreamSequenceToken token = null)
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.

Parameters

handleStreamSubscriptionHandle<T>
The subscription handle.
onNextAsyncFunc<T, StreamSequenceToken, Task>
Delegate that is called for IAsyncObserver.OnNextAsync.
onErrorAsyncFunc<Exception, Task>
Delegate that is called for IAsyncObserver.OnErrorAsync.
tokenStreamSequenceToken
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.

ResumeAsync(StreamSubscriptionHandle<T>, Func<T, StreamSequenceToken, Task>, Func<Task>, StreamSequenceToken)

staticextension
View source
public static Task<StreamSubscriptionHandle<T>> ResumeAsync<T>(this StreamSubscriptionHandle<T> handle, Func<T, StreamSequenceToken, Task> onNextAsync, Func<Task> onCompletedAsync, StreamSequenceToken token = null)
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.

Parameters

handleStreamSubscriptionHandle<T>
The subscription handle.
onNextAsyncFunc<T, StreamSequenceToken, Task>
Delegate that is called for IAsyncObserver.OnNextAsync.
onCompletedAsyncFunc<Task>
Delegate that is called for IAsyncObserver.OnCompletedAsync.
tokenStreamSequenceToken
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.

ResumeAsync(StreamSubscriptionHandle<T>, Func<T, StreamSequenceToken, Task>, StreamSequenceToken)

staticextension
View source
public static Task<StreamSubscriptionHandle<T>> ResumeAsync<T>(this StreamSubscriptionHandle<T> handle, Func<T, StreamSequenceToken, Task> onNextAsync, StreamSequenceToken token = null)
Thrown if the supplied stream filter function is not suitable. Usually this is because it is not a static method.

Parameters

handleStreamSubscriptionHandle<T>
The subscription handle.
onNextAsyncFunc<T, StreamSequenceToken, Task>
Delegate that is called for IAsyncObserver.OnNextAsync.
tokenStreamSequenceToken
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.