TaskBuilderBase Type
Contains methods to build TaskLikes using the F# computation expression syntax
Constructors
Constructor | Description |
|
|
Instance members
Instance member | Description |
Full Usage:
this.Bind
Parameters:
^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 |
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.
|
Full Usage:
this.BindReturn
Parameters:
^Awaiter
mapper : 'a -> 'TResult
Returns: TaskBaseCode<'TResult, 'TResult, ^a0>
Modifiers: inline Type parameters: ^Awaiter, 'a, 'TResult, ^a |
|
Full Usage:
this.Combine
Parameters:
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 |
The existence of this method permits the use of expression sequencing in the task { ... } computation expression syntax.
|
Full Usage:
this.Delay
Parameters:
unit -> ResumableCode<'TOverall, 'T>
-
The function to run
Returns: ResumableCode<'TOverall, 'T>
A task that runs generator
Modifiers: inline Type parameters: 'TOverall, 'T |
|
Full Usage:
this.For
Parameters:
'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 |
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.
|
Full Usage:
this.For
Parameters:
'a
body : 'T -> TaskBaseCode<'b, unit, ^Builder>
Returns: TaskBaseCode<'b, unit, ^Builder>
Modifiers: inline Type parameters: 'a, 'T, 'b, ^Builder |
|
Full Usage:
this.Return
Parameters:
'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 |
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.
|
Full Usage:
this.ReturnFrom
Parameters:
^Awaiter
Returns: TaskBaseCode<'a, 'a, ^Builder>
The input computation.
Modifiers: inline Type parameters: ^Awaiter, 'a, ^Builder |
The existence of this method permits the use of return! in the task { ... } computation expression syntax.
|
Full Usage:
this.TryFinally
Parameters:
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.
|
Full Usage:
this.TryWith
Parameters:
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 |
The existence of this method permits the use of try/with in the task { ... } computation expression syntax.
|
Full Usage:
this.Using
Parameters:
'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 |
The existence of this method permits the use of use and use! in the task { ... } computation expression syntax.
|
Full Usage:
this.While
Parameters:
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 |
The existence of this method permits the use of while in the task { ... } computation expression syntax.
|
Full Usage:
this.Zero
Returns: TaskBaseCode<'TOverall, unit, 'Builder>
a Task that returns ().
Modifiers: inline Type parameters: 'TOverall, 'Builder |
The existence of this method permits the use of empty else branches in the task { ... } computation expression syntax.
|
Static members
Static member | Description |
Full Usage:
TaskBuilderBase.BindDynamic(sm, awaiter, continuation)
Parameters:
byref<ResumableStateMachine<TaskBaseStateMachineData<'TOverall, 'Builder>>>
awaiter : ^Awaiter
continuation : 'TResult1 -> TaskBaseCode<'TOverall, 'TResult2, 'Builder>
Returns: bool
Modifiers: inline Type parameters: 'TOverall, 'Builder, ^Awaiter, 'TResult1, 'TResult2 |
|