Interface IAsyncReactiveObserver<T>
Interface for observers of event streams.
Namespace: Reaqtor
Assembly: Reaqtor.Local.Model.dll
Syntax
public interface IAsyncReactiveObserver<in T>
Type Parameters
Name | Description |
---|---|
T | Type of the data received by the observer. |
Methods
OnCompletedAsync(CancellationToken)
Reports completion of the stream.
Declaration
Task OnCompletedAsync(CancellationToken token = null)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | token | Token to observe for cancellation of the request. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task to await the acknowledgement of the submission of the event, or an exception. |
Remarks
If observer calls are not awaited in a sequential manner, the order of events in the stream as observed by the server is undefined.
OnErrorAsync(Exception, CancellationToken)
Reports an error to the stream.
Declaration
Task OnErrorAsync(Exception error, CancellationToken token = null)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | error | Error to report on the stream. |
System.Threading.CancellationToken | token | Token to observe for cancellation of the request. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task to await the acknowledgement of the submission of the event, or an exception. |
Remarks
If observer calls are not awaited in a sequential manner, the order of events in the stream as observed by the server is undefined.
OnNextAsync(T, CancellationToken)
Sends a value to the stream.
Declaration
Task OnNextAsync(T value, CancellationToken token = null)
Parameters
Type | Name | Description |
---|---|---|
T | value | Object to send to the stream. |
System.Threading.CancellationToken | token | Token to observe for cancellation of the request. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task to await the acknowledgement of the submission of the event, or an exception. |
Remarks
If observer calls are not awaited in a sequential manner, the order of events in the stream as observed by the server is undefined.