Skip to content

Instantly share code, notes, and snippets.

@vshapenko
Created June 13, 2019 11:35
Show Gist options
  • Save vshapenko/eb0e614a607f53b30c93760b96e757e5 to your computer and use it in GitHub Desktop.
Save vshapenko/eb0e614a607f53b30c93760b96e757e5 to your computer and use it in GitHub Desktop.
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