Skip to content

Instantly share code, notes, and snippets.

@7sharp9
Created December 6, 2011 00:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 7sharp9/1436093 to your computer and use it in GitHub Desktop.
Save 7sharp9/1436093 to your computer and use it in GitHub Desktop.
pipelets loop option2
let mailbox = MailboxProcessor.Start(fun inbox ->
let rec loop routes = async {
let! msg = inbox.Receive()
match msg with
| Payload(data) ->
ss.Release() |> ignore
let result = compute data routes |> Async.Catch |> Async.RunSynchronously
match result with
| Choice1Of2 _ -> ()
| Choice2Of2 exn -> errors exn
return! loop routes
| Attach(stage) -> return! loop (stage::routes)
| Detach(stage) -> return! loop (List.filter (fun x -> x <> stage) routes)
}
loop [])
@panesofglass
Copy link

What's the MSDN reference for this implementation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment