Skip to content

Instantly share code, notes, and snippets.

@medigor
Last active July 7, 2021 10:34
Show Gist options
  • Save medigor/6c876456342823c359fc2e0f905b4096 to your computer and use it in GitHub Desktop.
Save medigor/6c876456342823c359fc2e0f905b4096 to your computer and use it in GitHub Desktop.
open System
type SocketMessage =
| Fake
module Testt =
let sendMb = MailboxProcessor<SocketMessage>.Start(fun inbox ->
let rec loop () =
async {
do! Async.Sleep(0) // !!! required
match! inbox.Receive() with
| Fake ->
return! loop ()
}
loop ()
)
[<EntryPoint>]
let main argv =
for i in 1..20 do
Testt.sendMb.Post(Fake)
Console.ReadKey() |> ignore
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment