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 aref = | |
spawn system "actor" | |
<| fun mailbox -> | |
printf "pre-start" // this section works like pre-start | |
mailbox.Defer (fun () -> printf "post-stop") // this registers a function to be called on PostStop | |
let rec loop () = | |
actor { | |
let! msg = mailbox.Receive () | |
// do some work | |
return! loop () |