Last active
October 15, 2018 18:04
-
-
Save dbrattli/786ce277cf33b8f464cf0678f9fdf447 to your computer and use it in GitHub Desktop.
Scheduler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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