WitnessAsync class¶
Defined in
Namespace: ReactiveUI.Primitives.Async
Assembly: ReactiveUI.Primitives.Async.dll
Full name: ReactiveUI.Primitives.Async.WitnessAsync<T>
Modifiers: public abstract
Summary¶
Represents an asynchronous observer that processes notifications of type T using asynchronous methods.
Applies to
net10.0, net10.0, net10.0-desktop1.0, net10.0-desktop1.0, net10.0-browserwasm1.0, net10.0-browserwasm1.0, net9.0, net9.0, net9.0-desktop1.0, net9.0-desktop1.0, net9.0-browserwasm1.0, net9.0-browserwasm1.0, net8.0, net8.0, net8.0-ios17.5, net8.0-macos14.5, net8.0-macos14.5, net8.0-macos14.2, net8.0-macos14.2, net8.0-maccatalyst17.5, net8.0-maccatalyst17.5, net8.0-tvos17.2, net8.0-tvos17.2, net8.0-ios17.5, netstandard2.1, netstandard2.1, net481, net462, net462, net481
Class hierarchy
classDiagram
class WitnessAsync~T~
class IObserverAsync~T~ {
<>
}
IObserverAsync~T~ <|.. WitnessAsync~T~
class IAsyncDisposable {
<>
}
IAsyncDisposable <|.. WitnessAsync~T~
class IReentrantAsyncDisposable {
<>
}
IReentrantAsyncDisposable <|.. WitnessAsync~T~
Implements: IObserverAsyncIReentrantAsyncDisposable
Remarks¶
Implement this abstract class to handle asynchronous event streams or push-based data sources, where notifications may arrive concurrently or in rapid succession. The observer provides asynchronous methods for handling new data, errors, and completion signals, and supports proper resource cleanup via asynchronous disposal. Instances are not thread-safe for concurrent notification handling; notifications are processed sequentially, and reentrant calls are detected and reported as unhandled exceptions.
Constructors¶
| Name | Summary |
|---|---|
| .ctor | Initializes a new instance of the [WitnessAsync](# class. |
Methods¶
| Name | Summary |
|---|---|
| OnNextAsync | Asynchronously processes the next value in the sequence. |
| OnErrorResumeAsync | Handles an error by attempting to resume processing asynchronously. |
| OnCompletedAsync | Asynchronously performs completion logic when the operation has finished, handling any finalization or cleanup tasks required. |
| DisposeAsync | Asynchronously releases the resources used by the object. |
| OnCompletedAsyncCore | Performs asynchronous completion logic when the operation has finished processing the specified result. |
| LinkExternalCancellation | Links an external cancellation token into this observer's dispose chain. When external is cancelled, the observer disposes — propagating cancellation through the linked token that subclasses ... |
| DisposeAsyncCore | Performs application-defined tasks associated with asynchronously releasing unmanaged resources. |
| OnErrorResumeAsyncCore | Handles an error by providing an asynchronous mechanism to resume execution after an exception occurs. |
| OnNextAsyncCore | Processes the next value in the asynchronous sequence. |