Created
June 30, 2011 11:46
-
-
Save AlexCuse/1056072 to your computer and use it in GitHub Desktop.
subscriber usage
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
let Run<'T when 'T: not struct and 'T:null and 'T:equality> (errorCallback, ct:CancellationToken, finished:ManualResetEvent) = | |
let sub = new Subscriber<'T>() | |
sub.ReceivedMessages(ct) | |
|> Seq.iter (fun msg -> | |
try | |
write msg | |
with | ex -> | |
sub.Return msg | |
errorCallback ex) | |
finished.Set() |> ignore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment