IAsyncObserver<T> Interface

Definition

Provides a mechanism for receiving push-based asynchronous notifications.

public interface IAsyncObserver<in T>
type IAsyncObserver<'T> = interface
Public Interface IAsyncObserver(Of In T)

Type Parameters

T

The type of the elements received by the observer.

This type parameter is contravariant. That is, you can use either the type you specified or any type that is less derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics.

Remarks

This interface provides an async-native observer pattern where all notification methods return ValueTask. Subscription cancellation is handled via IAsyncDisposable rather than CancellationToken.

Methods

Name Description
OnCompletedAsync()

Notifies the observer that the provider has finished sending push-based notifications.

OnErrorAsync(Exception)

Notifies the observer that the provider has experienced an error condition.

OnNextAsync(T)

Provides the observer with new data.

Applies to