Skip to content

WitnessAsync class

Defined in

Namespace: ReactiveUI.Primitives.Async Assembly: ReactiveUI.Primitives.Async.dll Full name: ReactiveUI.Primitives.Async.WitnessAsync<T> Modifiers: public abstract

Summary

View source

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: IObserverAsync, IAsyncDisposable, IReentrantAsyncDisposable

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

NameSummary
.ctorInitializes a new instance of the [WitnessAsync](# class.

Methods

NameSummary
OnNextAsyncAsynchronously processes the next value in the sequence.
OnErrorResumeAsyncHandles an error by attempting to resume processing asynchronously.
OnCompletedAsyncAsynchronously performs completion logic when the operation has finished, handling any finalization or cleanup tasks required.
DisposeAsyncAsynchronously releases the resources used by the object.
OnCompletedAsyncCorePerforms asynchronous completion logic when the operation has finished processing the specified result.
LinkExternalCancellationLinks 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 ...
DisposeAsyncCorePerforms application-defined tasks associated with asynchronously releasing unmanaged resources.
OnErrorResumeAsyncCoreHandles an error by providing an asynchronous mechanism to resume execution after an exception occurs.
OnNextAsyncCoreProcesses the next value in the asynchronous sequence.
Inherited members