Skip to content

Instantly share code, notes, and snippets.

@dbrattli
Last active October 15, 2018 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbrattli/786ce277cf33b8f464cf0678f9fdf447 to your computer and use it in GitHub Desktop.
Save dbrattli/786ce277cf33b8f464cf0678f9fdf447 to your computer and use it in GitHub Desktop.
Scheduler
type Computation = unit -> unit
let scheduler = MailboxProcessor<Computation>.Start (fun inbox ->
let rec loop () = async {
let! action = inbox.Receive()
action ()
do! loop ()
}
loop ()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment