Created
July 10, 2014 11:48
-
-
Save kashmervil/d5e66d4e20f577a65222 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 event = new Event<int>() | |
let evp = event.Publish | |
let rand() = System.Random().Next(100) | |
evp.Add(printfn "event raised with %d") | |
let rec loop() = async { | |
event.Trigger <| rand() | |
System.Threading.Thread.Sleep(3000) | |
printfn "Thread number %A" System.Threading.Thread.CurrentThread.ManagedThreadId | |
return! loop() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment