Skip to content

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

public static ValueTask ForwardOnCompletedConcurrently<T>(ImmutableArray<IObserverAsync<T>> observers, Result result)

View source

Summary: Invokes the OnCompletedAsync method on each observer in the collection concurrently, forwarding the specified result to all observers.

Type parameters

NameDescription
TThe type of the elements observed by the observers.

Parameters

NameTypeDescription
observersImmutableArray>A read-only list of observers to which the completion notification will be forwarded. Cannot be null.
result[Result](#The result to pass to each observer's OnCompletedAsync method.

Returns: ValueTask -- A ValueTask that represents the asynchronous operation of notifying all observers. The task completes when all observers have finished processing the completion notification. If the observers list is empty, a default ValueTask is returned.

Remarks

All observers are notified concurrently. The returned ValueTask completes when all OnCompletedAsync operations have finished. If any observer throws an exception, the returned task will complete with an AggregateException containing all exceptions thrown.