Class AsyncReactiveObserverBase<T>
Base class for observers.
Implements
Namespace: Reaqtor
Assembly: Reaqtor.Local.Core.dll
Syntax
public abstract class AsyncReactiveObserverBase<T> : Object, IAsyncReactiveObserver<T>
Type Parameters
Name | Description |
---|---|
T | Type of the data received by the observable. |
Constructors
AsyncReactiveObserverBase()
Declaration
protected AsyncReactiveObserverBase()
Methods
OnCompletedAsync(CancellationToken)
Reports completion of the observer.
Declaration
public 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 processing order of events in the observer is undefined.
OnCompletedAsyncCore(CancellationToken)
Reports completion of the observer.
Declaration
protected abstract Task OnCompletedAsyncCore(CancellationToken token)
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 processing order of events in the observer is undefined.
OnErrorAsync(Exception, CancellationToken)
Reports an error to the observer.
Declaration
public Task OnErrorAsync(Exception error, CancellationToken token = null)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | error | Error to report on the observer. |
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 processing order of events in the observer is undefined.
OnErrorAsyncCore(Exception, CancellationToken)
Reports an error to the observer.
Declaration
protected abstract Task OnErrorAsyncCore(Exception error, CancellationToken token = null)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | error | Error to report on the observer. |
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 processing order of events in the observer is undefined.
OnNextAsync(T, CancellationToken)
Sends a value to the observer.
Declaration
public Task OnNextAsync(T value, CancellationToken token = null)
Parameters
Type | Name | Description |
---|---|---|
T | value | Object to send to the observer. |
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 processing order of events in the observer is undefined.
OnNextAsyncCore(T, CancellationToken)
Sends a value to the observer.
Declaration
protected abstract Task OnNextAsyncCore(T value, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
T | value | Object to send to the observer. |
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 processing order of events in the observer is undefined.