Skip to content

IAsyncBatchObservable<T> Methods

This interface generalizes the IAsyncObserver interface to allow production and consumption of batches of items.

Note that this interface is implemented by item consumers and invoked (used) by item producers. This means that the consumer endpoint of a stream implements this interface.

SubscribeAsync(IAsyncBatchObserver<T>)

abstract
public abstract Task<StreamSubscriptionHandle<T>> SubscribeAsync(IAsyncBatchObserver<T> observer)
Subscribe a consumer to this batch observable.

Parameters

observerIAsyncBatchObserver<T>
The asynchronous batch 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.

SubscribeAsync(IAsyncBatchObserver<T>, StreamSequenceToken?)

abstract
public abstract Task<StreamSubscriptionHandle<T>> SubscribeAsync(IAsyncBatchObserver<T> observer, StreamSequenceToken? token)
Subscribe a consumer to this batch observable.

Parameters

observerIAsyncBatchObserver<T>
The asynchronous batch observer to subscribe.
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.