Created
June 13, 2019 11:35
-
-
Save vshapenko/eb0e614a607f53b30c93760b96e757e5 to your computer and use it in GitHub Desktop.
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 Msg= | |
|Add of List<int> | |
|Get of AsyncReplyChannel<int list> | |
let evt=new Event<string>() | |
let queueBox=MailboxProcessor.Start (fun inbox-> | |
let rec loop state= | |
async{ | |
let! msg=inbox.Receive() | |
match msg with | |
|Add x->evt.Trigger("LALALA") | |
return! loop (state@x) | |
|Get ch-> | |
ch.Reply state | |
return! loop List.empty | |
} | |
loop List.empty | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment