AsyncBuilder (FSharp.Core)
Creates an asynchronous computation that runs computation, and when
computation generates a result T, runs binder res.
Creates an asynchronous computation that runs computation, and when
computation generates a result T, runs binder res.
-
computation
:
Async<'T> -
The computation to provide an unbound result.
-
binder
:
'T -> Async<'U> -
The function to bind the result of
computation.
-
Returns:
Async<'U> -
An asynchronous computation that performs a monadic bind on the result of
computation.
Creates an asynchronous computation that first runs computation1
and then runs computation2, returning the result of computation2.
Creates an asynchronous computation that first runs computation1
and then runs computation2, returning the result of computation2.
-
computation1
:
Async<unit> -
The first part of the sequenced computation.
-
computation2
:
Async<'T> -
The second part of the sequenced computation.
-
Returns:
Async<'T> -
An asynchronous computation that runs both of the computations sequentially.
Creates an asynchronous computation that runs generator.
Creates an asynchronous computation that runs generator.
-
Returns:
Async<'T> -
An asynchronous computation that runs
generator.
Creates an asynchronous computation that enumerates the sequence seq
on demand and runs body for each element.
Creates an asynchronous computation that enumerates the sequence seq
on demand and runs body for each element.
Creates an asynchronous computation that returns the result v.
Creates an asynchronous computation that returns the result v.
-
value
:
'T -
The value to return from the computation.
-
Returns:
Async<'T> -
An asynchronous computation that returns
valuewhen executed.
Delegates to the input computation.
Delegates to the input computation.
-
computation
:
Async<'T> -
The input computation.
-
Returns:
Async<'T> -
The input computation.
Creates an asynchronous computation 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.
Creates an asynchronous computation 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.
-
computation
:
Async<'T> -
The input computation.
-
compensation
:
unit -> unit -
The action to be run after
computationcompletes or raises an exception (including cancellation).
-
Returns:
Async<'T> -
An asynchronous computation that executes computation and compensation afterwards or when an exception is raised.
Creates an asynchronous computation that runs computation and returns its result.
If an exception happens then catchHandler(exn) is called and the resulting computation executed instead.
Creates an asynchronous computation that runs computation and returns its result.
If an exception happens then catchHandler(exn) is called and the resulting computation executed instead.
-
computation
:
Async<'T> -
The input computation.
-
catchHandler
:
exn -> Async<'T> -
The function to run when
computationthrows an exception.
-
Returns:
Async<'T> -
An asynchronous computation that executes
computationand callscatchHandlerif an exception is thrown.
Creates an asynchronous computation that runs binder(resource).
The action resource.Dispose() is executed as this computation yields its result
or if the asynchronous computation exits by an exception or by cancellation.
Creates an asynchronous computation that runs binder(resource).
The action resource.Dispose() is executed as this computation yields its result
or if the asynchronous computation exits by an exception or by cancellation.
-
resource
:
'T -
The resource to be used and disposed.
-
binder
:
'T -> Async<'U> -
The function that takes the resource and returns an asynchronous computation.
-
Returns:
Async<'U> -
An asynchronous computation that binds and eventually disposes
resource.