Header menu logo IcedTasks

ValueTaskExtensions Module

Module with extension methods for ValueTask.

Type extensions

Type extension Description

Async.AsValueTask(computation)

Full Usage: Async.AsValueTask(computation)

Parameters:
    computation : Async<'T>

Returns: ValueTask<'T>
Modifiers: inline
Type parameters: 'T

Runs an asynchronous computation, starting immediately on the current operating system thread, but also returns the execution as ValueTask.

Extended Type: Async

computation : Async<'T>
Returns: ValueTask<'T>

Async.AwaitValueTask(vTask)

Full Usage: Async.AwaitValueTask(vTask)

Parameters:
Returns: Async<'a>
Modifiers: inline
Type parameters: 'a

Return an asynchronous computation that will check if ValueTask is completed or wait for the given task to complete and return its result.

Extended Type: Async

vTask : ValueTask<'a>

The task to await.

Returns: Async<'a>

Async.AwaitValueTask(vTask)

Full Usage: Async.AwaitValueTask(vTask)

Parameters:
Returns: Async<unit>
Modifiers: inline

Return an asynchronous computation that will check if ValueTask is completed or wait for the given task to complete and return its result.

Extended Type: Async

vTask : ValueTask

The task to await.

Returns: Async<unit>

ValueTask.FromCanceled(cancellationToken)

Full Usage: ValueTask.FromCanceled(cancellationToken)

Parameters:
    cancellationToken : CancellationToken - The cancellation token with which to complete the task.

Returns: ValueTask The canceled task.

Creates a ValueTask that's completed due to cancellation with a specified cancellation token.

Extended Type: ValueTask

cancellationToken : CancellationToken

The cancellation token with which to complete the task.

Returns: ValueTask

The canceled task.

ArgumentOutOfRangeException Cancellation has not been requested for cancellationToken; its CancellationToken.IsCancellationRequested property is .

ValueTask.FromCanceled(cancellationToken)

Full Usage: ValueTask.FromCanceled(cancellationToken)

Parameters:
    cancellationToken : CancellationToken - The cancellation token with which to complete the task.

Returns: ValueTask<'T> The canceled task.

Creates a ValueTask that's completed due to cancellation with a specified cancellation token.

Extended Type: ValueTask

cancellationToken : CancellationToken

The cancellation token with which to complete the task.

Returns: ValueTask<'T>

The canceled task.

ArgumentOutOfRangeException Cancellation has not been requested for cancellationToken; its CancellationToken.IsCancellationRequested property is .

Type something to start searching.