Created
December 7, 2017 04:43
-
-
Save dustinlacewell-wk/464d2b8cce2951825b168d78f475cf69 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
let create (x: 'a) : Job<Cell<'a>> = Job.delay <| fun () -> | |
let c = {reqCh = Ch (); replyCh = Ch ()} | |
let rec server x = | |
Ch.take c.reqCh >>= function | |
| Get -> | |
Ch.give c.replyCh x >>=. server x | |
| Put x -> server x | |
Job.start (server x) >>-. c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment