Created
April 16, 2015 09:04
-
-
Save Leonidas-from-XIV/c44f2770df12001a54e2 to your computer and use it in GitHub Desktop.
Timeouts in Lwt; build with ocamlbuild -pkgs lwt.unix ti.native
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
let () = | |
let sleep, wake = Lwt.wait () in | |
let ti = Lwt_timeout.create 2 (fun () -> | |
print_endline "oh hai"; | |
Lwt.wakeup_later wake ()) in | |
Lwt_timeout.start ti; | |
Lwt_main.run sleep |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment