)} })} },ReactiveUI.Primitives.Concurrency.ISequencer)} },ReactiveUI.Primitives.Concurrency.ISequencer,System.Threading.CancellationTokenSource)} })} },ReactiveUI.Primitives.Concurrency.ISequencer)} },ReactiveUI.Primitives.Concurrency.ISequencer,System.Threading.CancellationTokenSource)}
Signal.FromTask(Task) method¶
Defined in
Type: Signal
Namespace: ReactiveUI.Primitives.Signals
Assembly: ReactiveUI.Primitives.dll
Applies to
net10.0, net10.0-android36.0, net10.0-ios26.0, net10.0-macos26.0, net10.0-tvos26.0, net10.0-maccatalyst26.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-desktop1.0, net9.0-browserwasm1.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, net481, net471, net462
Overloads¶
- 1.
public static IObservable<T> FromTask<T>(Task<T> task) - 2.
public static ITaskSignal<RxVoid> FromTask(Func<CancellationTokenSource, Task<RxVoid>> execution) - 3.
public static ITaskSignal<RxVoid> FromTask(Func<CancellationTokenSource, Task<RxVoid>> execution, ISequencer? scheduler) - 4.
public static ITaskSignal<RxVoid> FromTask(Func<CancellationTokenSource, Task<RxVoid>> execution, ISequencer? scheduler, CancellationTokenSource? cancellationTokenSource) - 5.
public static ITaskSignal<TResult> FromTask<TResult>(Func<CancellationTokenSource, Task<TResult>> actionAsync) - 6.
public static ITaskSignal<TResult> FromTask<TResult>(Func<CancellationTokenSource, Task<TResult>> actionAsync, ISequencer? scheduler) - 7.
public static ITaskSignal<TResult> FromTask<TResult>(Func<CancellationTokenSource, Task<TResult>> actionAsync, ISequencer? scheduler, CancellationTokenSource? cancellationTokenSource)
1. Overload¶
public static IObservable<T> FromTask<T>(Task<T> task)
Summary: Creates a signal from a task instance.
Type parameters
| Name | Description |
|---|---|
T | The type. |
Parameters
| Name | Type | Description |
|---|---|---|
task | Task | The task to convert. |
Returns: IObservable
2. Overload¶
public static ITaskSignal<RxVoid> FromTask(Func<CancellationTokenSource, Task<RxVoid>> execution)
Summary: Handles Asnyc Tasks with cancellation.
Parameters
| Name | Type | Description |
|---|---|---|
execution | Func | The function to execute. |
Returns: ITaskSignal
3. Overload¶
public static ITaskSignal<RxVoid> FromTask(Func<CancellationTokenSource, Task<RxVoid>> execution, ISequencer? scheduler)
Summary: Handles Asnyc Tasks with cancellation.
Parameters
| Name | Type | Description |
|---|---|---|
execution | Func | The function to execute. |
scheduler | [ISequencer?](# | The scheduler. |
Returns: ITaskSignal
4. Overload¶
public static ITaskSignal<RxVoid> FromTask(Func<CancellationTokenSource, Task<RxVoid>> execution, ISequencer? scheduler, CancellationTokenSource? cancellationTokenSource)
Summary: Handles Asnyc Tasks with cancellation.
Parameters
| Name | Type | Description |
|---|---|---|
execution | Func | The function to execute. |
scheduler | [ISequencer?](# | The scheduler. |
cancellationTokenSource | CancellationTokenSource? | The cancellation token source. |
Returns: ITaskSignal
5. Overload¶
public static ITaskSignal<TResult> FromTask<TResult>(Func<CancellationTokenSource, Task<TResult>> actionAsync)
Summary: Froms the asynchronous.
Type parameters
| Name | Description |
|---|---|
TResult | The type of the return value. |
Parameters
| Name | Type | Description |
|---|---|---|
actionAsync | Func | The action asynchronous. |
Returns: ITaskSignal
6. Overload¶
public static ITaskSignal<TResult> FromTask<TResult>(Func<CancellationTokenSource, Task<TResult>> actionAsync, ISequencer? scheduler)
Summary: Froms the asynchronous.
Type parameters
| Name | Description |
|---|---|
TResult | The type of the return value. |
Parameters
| Name | Type | Description |
|---|---|---|
actionAsync | Func | The action asynchronous. |
scheduler | [ISequencer?](# | The scheduler. |
Returns: ITaskSignal
7. Overload¶
public static ITaskSignal<TResult> FromTask<TResult>(Func<CancellationTokenSource, Task<TResult>> actionAsync, ISequencer? scheduler, CancellationTokenSource? cancellationTokenSource)
Summary: Froms the asynchronous.
Type parameters
| Name | Description |
|---|---|
TResult | The type of the return value. |
Parameters
| Name | Type | Description |
|---|---|---|
actionAsync | Func | The action asynchronous. |
scheduler | [ISequencer?](# | The scheduler. |
cancellationTokenSource | CancellationTokenSource? | The cancellation token source. |
Returns: ITaskSignal