Header menu logo IcedTasks

TaskBuilderBase Type

Contains methods to build TaskLikes using the F# computation expression syntax

Constructors

Constructor Description

TaskBuilderBase()

Full Usage: TaskBuilderBase()

Returns: TaskBuilderBase
Returns: TaskBuilderBase

Instance members

Instance member Description

this.Bind

Full Usage: this.Bind

Parameters:
    awaiter : ^Awaiter
    continuation : 'TResult1 -> TaskBaseCode<'TOverall, 'TResult2, ^Builder> - The function to bind the result of computation.

Returns: TaskBaseCode<'TOverall, 'TResult2, ^Builder> a Task that performs a monadic bind on the result of computation.
Modifiers: inline
Type parameters: ^Awaiter, 'TResult1, 'TOverall, 'TResult2, ^Builder

Creates a Task that runs computation, and when computation generates a result T, runs binder res.

A cancellation check is performed when the computation is executed. The existence of this method permits the use of let! in the task { ... } computation expression syntax.

awaiter : ^Awaiter
continuation : 'TResult1 -> TaskBaseCode<'TOverall, 'TResult2, ^Builder>

The function to bind the result of computation.

Returns: TaskBaseCode<'TOverall, 'TResult2, ^Builder>

a Task that performs a monadic bind on the result of computation.

this.BindReturn

Full Usage: this.BindReturn

Parameters:
    awaiter : ^Awaiter
    mapper : 'a -> 'TResult

Returns: TaskBaseCode<'TResult, 'TResult, ^a0>
Modifiers: inline
Type parameters: ^Awaiter, 'a, 'TResult, ^a
awaiter : ^Awaiter
mapper : 'a -> 'TResult
Returns: TaskBaseCode<'TResult, 'TResult, ^a0>

this.Combine

Full Usage: this.Combine

Parameters:
    task1 : TaskBaseCode<'TOverall, unit, 'Builder> - The first part of the sequenced computation.
    task2 : TaskBaseCode<'TOverall, 'T, 'Builder> - The second part of the sequenced computation.

Returns: TaskBaseCode<'TOverall, 'T, 'Builder> a Task that runs both of the computations sequentially.
Modifiers: inline
Type parameters: 'TOverall, 'Builder, 'T

Creates a Task that first runs task1 and then runs computation2, returning the result of computation2.

The existence of this method permits the use of expression sequencing in the task { ... } computation expression syntax.

task1 : TaskBaseCode<'TOverall, unit, 'Builder>

The first part of the sequenced computation.

task2 : TaskBaseCode<'TOverall, 'T, 'Builder>

The second part of the sequenced computation.

Returns: TaskBaseCode<'TOverall, 'T, 'Builder>

a Task that runs both of the computations sequentially.

this.Delay

Full Usage: this.Delay

Parameters:
    generator : unit -> ResumableCode<'TOverall, 'T> - The function to run

Returns: ResumableCode<'TOverall, 'T> A task that runs generator
Modifiers: inline
Type parameters: 'TOverall, 'T

Creates a ValueTask that runs generator

generator : unit -> ResumableCode<'TOverall, 'T>

The function to run

Returns: ResumableCode<'TOverall, 'T>

A task that runs generator

this.For

Full Usage: this.For

Parameters:
    sequence : 'T seq - The sequence to enumerate.
    body : 'T -> TaskBaseCode<'TOverall, unit, 'Builder> - A function to take an item from the sequence and create a Task. Can be seen as the body of the for expression.

Returns: TaskBaseCode<'TOverall, unit, 'Builder> a Task that will enumerate the sequence and run body for each element.
Modifiers: inline
Type parameters: 'T, 'TOverall, 'Builder

Creates a Task that enumerates the sequence seq on demand and runs body for each element.

A cancellation check is performed on each iteration of the loop. The existence of this method permits the use of for in the task { ... } computation expression syntax.

sequence : 'T seq

The sequence to enumerate.

body : 'T -> TaskBaseCode<'TOverall, unit, 'Builder>

A function to take an item from the sequence and create a Task. Can be seen as the body of the for expression.

Returns: TaskBaseCode<'TOverall, unit, 'Builder>

a Task that will enumerate the sequence and run body for each element.

this.For

Full Usage: this.For

Parameters:
Returns: TaskBaseCode<'b, unit, ^Builder>
Modifiers: inline
Type parameters: 'a, 'T, 'b, ^Builder
source : 'a
body : 'T -> TaskBaseCode<'b, unit, ^Builder>
Returns: TaskBaseCode<'b, unit, ^Builder>

this.Return

Full Usage: this.Return

Parameters:
    value : 'T - The value to return from the computation.

Returns: TaskBaseCode<'T, 'T, 'Builder> a Task that returns value when executed.
Modifiers: inline
Type parameters: 'T, 'Builder

Creates an computation that returns the result v.

A cancellation check is performed when the computation is executed. The existence of this method permits the use of return in the task { ... } computation expression syntax.

value : 'T

The value to return from the computation.

Returns: TaskBaseCode<'T, 'T, 'Builder>

a Task that returns value when executed.

this.ReturnFrom

Full Usage: this.ReturnFrom

Parameters:
    awaiter : ^Awaiter

Returns: TaskBaseCode<'a, 'a, ^Builder> The input computation.
Modifiers: inline
Type parameters: ^Awaiter, 'a, ^Builder

Delegates to the input computation.

The existence of this method permits the use of return! in the task { ... } computation expression syntax.

awaiter : ^Awaiter
Returns: TaskBaseCode<'a, 'a, ^Builder>

The input computation.

this.TryFinally

Full Usage: this.TryFinally

Parameters:
    computation : TaskBaseCode<'TOverall, 'T, 'Builder> - The input computation.
    compensation : unit -> unit - The action to be run after computation completes or raises an exception (including cancellation).

Returns: TaskBaseCode<'TOverall, 'T, 'Builder> a Task that executes computation and compensation afterwards or when an exception is raised.
Modifiers: inline
Type parameters: 'TOverall, 'T, 'Builder

Creates a Task that runs computation. The action compensation is executed after computation completes, whether computation exits normally or by an exception. If compensation raises an exception itself the original exception is discarded and the new exception becomes the overall result of the computation.

The existence of this method permits the use of try/finally in the task { ... } computation expression syntax.

computation : TaskBaseCode<'TOverall, 'T, 'Builder>

The input computation.

compensation : unit -> unit

The action to be run after computation completes or raises an exception (including cancellation).

Returns: TaskBaseCode<'TOverall, 'T, 'Builder>

a Task that executes computation and compensation afterwards or when an exception is raised.

this.TryWith

Full Usage: this.TryWith

Parameters:
    computation : TaskBaseCode<'TOverall, 'T, 'Builder> - The input computation.
    catchHandler : exn -> TaskBaseCode<'TOverall, 'T, 'Builder> - The function to run when computation throws an exception.

Returns: TaskBaseCode<'TOverall, 'T, 'Builder> a Task that executes computation and calls catchHandler if an exception is thrown.
Modifiers: inline
Type parameters: 'TOverall, 'T, 'Builder

Creates a Task that runs computation and returns its result. If an exception happens then catchHandler(exn) is called and the resulting computation executed instead.

The existence of this method permits the use of try/with in the task { ... } computation expression syntax.

computation : TaskBaseCode<'TOverall, 'T, 'Builder>

The input computation.

catchHandler : exn -> TaskBaseCode<'TOverall, 'T, 'Builder>

The function to run when computation throws an exception.

Returns: TaskBaseCode<'TOverall, 'T, 'Builder>

a Task that executes computation and calls catchHandler if an exception is thrown.

this.Using

Full Usage: this.Using

Parameters:
    resource : 'a - The resource to be used and disposed.
    binder : 'a -> TaskBaseCode<'TOverall, 'T, ^Builder> - The function that takes the resource and returns an asynchronous computation.

Returns: TaskBaseCode<'TOverall, 'T, ^Builder> a Task that binds and eventually disposes resource.
Modifiers: inline
Type parameters: 'a, 'TOverall, 'T, ^Builder

Creates a Task that runs binder(resource). The action resource.DisposeAsync() is executed as this computation yields its result or if the ValueTask exits by an exception or by cancellation.

The existence of this method permits the use of use and use! in the task { ... } computation expression syntax.

resource : 'a

The resource to be used and disposed.

binder : 'a -> TaskBaseCode<'TOverall, 'T, ^Builder>

The function that takes the resource and returns an asynchronous computation.

Returns: TaskBaseCode<'TOverall, 'T, ^Builder>

a Task that binds and eventually disposes resource.

this.While

Full Usage: this.While

Parameters:
    guard : unit -> bool - The function to determine when to stop executing computation.
    computation : TaskBaseCode<'TOverall, unit, 'Builder> - The function to be executed. Equivalent to the body of a while expression.

Returns: TaskBaseCode<'TOverall, unit, 'Builder> a Task that behaves similarly to a while loop when run.
Modifiers: inline
Type parameters: 'TOverall, 'Builder

Creates a Task that runs computation repeatedly until guard() becomes false.

The existence of this method permits the use of while in the task { ... } computation expression syntax.

guard : unit -> bool

The function to determine when to stop executing computation.

computation : TaskBaseCode<'TOverall, unit, 'Builder>

The function to be executed. Equivalent to the body of a while expression.

Returns: TaskBaseCode<'TOverall, unit, 'Builder>

a Task that behaves similarly to a while loop when run.

this.Zero

Full Usage: this.Zero

Returns: TaskBaseCode<'TOverall, unit, 'Builder> a Task that returns ().
Modifiers: inline
Type parameters: 'TOverall, 'Builder

Creates a Task that just returns ().

The existence of this method permits the use of empty else branches in the task { ... } computation expression syntax.

Returns: TaskBaseCode<'TOverall, unit, 'Builder>

a Task that returns ().

Static members

Static member Description

TaskBuilderBase.BindDynamic(sm, awaiter, continuation)

Full Usage: TaskBuilderBase.BindDynamic(sm, awaiter, continuation)

Parameters:
Returns: bool
Modifiers: inline
Type parameters: 'TOverall, 'Builder, ^Awaiter, 'TResult1, 'TResult2

The entry point for the dynamic implementation of the corresponding operation. Do not use directly, only used when executing quotations that involve tasks or other reflective execution of F# code.

sm : byref<ResumableStateMachine<TaskBaseStateMachineData<'TOverall, 'Builder>>>
awaiter : ^Awaiter
continuation : 'TResult1 -> TaskBaseCode<'TOverall, 'TResult2, 'Builder>
Returns: bool

Type something to start searching.