Agent = using message passing to avoid mutating state
type Downloader() =
let agent =
MailboxProcessor.Start(fun inbox ->
let rec loop() = async {
let msg=inbox.Receive()
do! Async.Sleep(5000)
return! loop()
}
loop()
)
member this.DowloadAll()=
while(true) do
agent.Post("test")
Monday, May 31, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment