BaseSubjectAsync class¶
Defined in
Namespace: ReactiveUI.Extensions.Async.Subjects
Assembly: ReactiveUI.Extensions.dll
Full name: ReactiveUI.Extensions.Async.Subjects.BaseSubjectAsync<T>
Modifiers: public abstract
Summary¶
Provides a base class for asynchronous subjects that support both publishing values to observers and receiving
values asynchronously.
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481
Class hierarchy
classDiagram
class BaseSubjectAsync~T~
class ObservableAsync~T~
ObservableAsync~T~ <|-- BaseSubjectAsync~T~
class ISubjectAsync~T~ {
<>
}
ISubjectAsync~T~ <|.. BaseSubjectAsync~T~
class IObserverAsync~T~ {
<>
}
IObserverAsync~T~ <|.. BaseSubjectAsync~T~
class IAsyncDisposable {
<>
}
IAsyncDisposable <|.. BaseSubjectAsync~T~
class IObservableAsync~T~ {
<>
}
IObservableAsync~T~ <|.. BaseSubjectAsync~T~
Inherits from: ObservableAsync
Implements: ISubjectAsync
Remarks¶
This class enables the implementation of asynchronous subjects that can broadcast values, errors, and completion notifications to multiple observers. It manages observer registration, notification, and completion in a thread-safe manner. Derived classes should override the core notification methods to customize how observers are notified asynchronously. The subject supports asynchronous subscription and notification patterns, making it suitable for reactive and event-driven programming scenarios.
Constructors¶
| Name | Summary |
|---|---|
| .ctor |
Methods¶
| Name | Summary |
|---|---|
| OnNextAsync | Asynchronously notifies all subscribed observers of a new value. |
| OnErrorResumeAsync | Notifies all observers of an error and allows asynchronous error handling to resume observation. |
| OnCompletedAsync | Notifies all registered observers that the asynchronous operation has completed and provides the final result. |
| DisposeAsync | Asynchronously releases the unmanaged resources used by the object. |
| SubscribeAsyncCore | Subscribes the specified asynchronous observer to receive notifications from the observable sequence. |
| OnNextAsyncCore | Asynchronously notifies the specified observers with the provided value. |
| OnErrorResumeAsyncCore | Handles error recovery for the specified observers by resuming asynchronous processing after an error occurs. |
| OnCompletedAsyncCore | Invoked to asynchronously notify all observers of the completion event with the specified result. |