Created
February 14, 2015 15:54
-
-
Save rogeralsing/80bafe4d9a7d9fe5f2db to your computer and use it in GitHub Desktop.
This file contains hidden or 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
open Akka.FSharp | |
open Akka | |
open Akka.Configuration | |
let system = System.create "my-system" (Configuration.defaultConfig()) | |
let aref = | |
spawn system "my-actor" | |
(fun mailbox -> | |
let rec loop(state) = actor { | |
let! message = mailbox.Receive() | |
//pseudo code: | |
// receive a message with upgraded code, extract the new state loop and loop with that | |
// I don't do F# so this is probably wrong syntax :-) | |
// | |
//match message with | |
//| Upgrade(newloop) -> return! newloop(state) | |
// | |
return! loop(state) | |
} | |
loop(...initial state...)) | |
aref <! Upgrade(..codequotation..) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment