Async.Start メソッド (F#)

更新 : 2010 年 7 月

スレッド プールの非同期計算を開始します。 結果を待機しません。

名前空間/モジュール パス: Microsoft.FSharp.Control

アセンブリ: FSharp.Core (FSharp.Core.dll 内)

// Signature:
static member Start : Async<unit> * ?CancellationToken -> unit

// Usage:
Async.Start (computation)
Async.Start (computation, cancellationToken = cancellationToken)

パラメーター

解説

キャンセル トークンが指定されていない場合は、既定のキャンセル トークンが使用されます。

使用例

スレッド プールで非同期計算を開始する方法を次のコード例に示します。

open System.Windows.Forms

let bufferData = Array.zeroCreate<byte> 100000000

let async1 =
     async {
       use outputFile = System.IO.File.Create("longoutput.dat")
       do! outputFile.AsyncWrite(bufferData) 
     }


let form = new Form(Text = "Test Form")
let button = new Button(Text = "Start")
form.Controls.Add(button)
button.Click.Add(fun args -> Async.Start(async1))
Application.Run(form)

プラットフォーム

Windows 7、Windows Vista SP2、Windows XP SP3、Windows XP x64 SP2、Windows Server 2008 R2、Windows Server 2008 SP2、Windows Server 2003 SP2

バージョン情報

F# ランタイム

サポート対象: 2.0、4.0

Silverlight

サポート: 3

参照

その他の技術情報

Control.Async クラス (F#)

Microsoft.FSharp.Control 名前空間 (F#)

履歴の変更

日付

履歴

理由

2010 年 7 月

コード例を追加。

情報の拡充