)>
Defined in Type: SignalAsyncReactiveExtensions
Namespace: ReactiveUI.Primitives.Async.Reactive
Assembly: ReactiveUI.Primitives.Async.Reactive.dll
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 IObservableAsync<Unit> FromAsync(Func<CancellationToken, ValueTask> factory)
Summary: Creates an asynchronous observable sequence that executes the specified factory function and signals completion when the operation finishes.
Parameters
| Name | Type | Description |
|---|---|---|
factory | Func | A function that performs the asynchronous operation. The function receives a cancellation token that can be used to cancel the operation. |
Returns: IObservableAsync
Remarks
The returned observable executes the factory function as a background job. The sequence emits Unit after the factory completes and then signals completion. Cancellation is supported via the provided token.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if factory is null. |