Compartilhar via


Control.AsyncBuilder Class (F#)

The type of the async operator, used to build workflows for asynchronous computations.

Namespace/Module Path: Microsoft.FSharp.Control

Assembly: FSharp.Core (in FSharp.Core.dll)

[<Sealed>]
type AsyncBuilder =
 class
  new AsyncBuilder : unit -> AsyncBuilder
  member this.Bind : Async<'T> * ('T -> Async<'U>) -> Async<'U>
  member this.Combine : Async<unit> * Async<'T> -> Async<'T>
  member this.Delay : (unit -> Async<'T>) -> Async<'T>
  member this.For : seq<'T> * ('T -> Async<unit>) -> Async<unit>
  member this.Return : 'T -> Async<'T>
  member this.ReturnFrom : Async<'T> -> Async<'T>
  member this.TryFinally : Async<'T> * (unit -> unit) -> Async<'T>
  member this.TryWith : Async<'T> * (exn -> Async<'T>) -> Async<'T>
  member this.Using : 'T * ('T -> Async<'U>) -> Async<'U>
  member this.While : (unit -> bool) * Async<unit> -> Async<unit>
  member this.Zero : unit -> Async<unit>
 end

Remarks

For general information on computation expressions and builder types, see Computation Expressions (F#).

This type is named FSharpAsyncBuilder in compiled assemblies. If accessing the type from a language other than F#, or through reflection, use this name.

Constructors

Member

Description

new

Generates an object used to build asynchronous computations using F# computation expressions. The value async is a pre-defined instance of this type. A cancellation check is performed when the computation is executed.

Instance Members

Member

Description

Bind

Implements let! in asynchronous computations.

Combine

Creates an asynchronous computation that first runs computation1 and then runs computation2, returning the result of computation2.

Delay

Creates an asynchronous computation that runs a function.

For

Implements the for expression in asynchronous computations.

Return

Implements the return expression in asynchronous computations. Creates an asynchronous computation that returns the specified result.

ReturnFrom

Implements the return! keyword for asynchronous computations. This function delegates to the input computation.

TryFinally

Implements try...finally in asynchronous computations.

TryWith

Implements try...with in asynchronous computations.

Using

Implements the use and use! keywords in asynchronous computation expressions.

While

Implements the while keyword in asynchronous computation expressions.

Zero

Creates an asynchronous computation that does nothing and returns ().

Platforms

Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2

Version Information

F# Core Library Versions

Supported in: 2.0, 4.0, Portable

See Also

Reference

Microsoft.FSharp.Control Namespace (F#)