Skip to content

Instantly share code, notes, and snippets.

@vkobel
Created April 24, 2014 12:00
Show Gist options
  • Save vkobel/11252078 to your computer and use it in GitHub Desktop.
Save vkobel/11252078 to your computer and use it in GitHub Desktop.
F# async simple example. Try it here: http://www.tryfsharp.org/create/vkobel/AsyncSimple.fsx
open System.Threading
let workThenWait() =
async {
do! Async.Sleep(1000)
printfn "work done"
}
let demo() =
printfn "started"
let work = workThenWait() |> Async.StartAsTask
printfn "completed"
work.Wait()
demo()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment