Created
July 27, 2011 13:49
-
-
Save phatboyg/1109393 to your computer and use it in GitHub Desktop.
How to stage build actors in an actor chain/network
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
public class MyActor : | |
Actor | |
{ | |
public MyActor(Inbox inbox) | |
{ | |
inbox.Receive<InitMyActor>(initMsg => | |
{ | |
var myActorScopeValue = initMsg.Scope; | |
inbox.Loop(loop => | |
{ | |
loop.Receive<UpdateMsg>(message => | |
{ | |
// do some work | |
loop.Continue(); // this tells the loop to keep running | |
} | |
loop.Receive<SomeOtherMsg>(message => | |
{ | |
// do some work | |
loop.Continue(); // this tells the loop to keep running | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment