Skip to content

Instantly share code, notes, and snippets.

@phatboyg
Created July 27, 2011 13:49
Show Gist options
  • Save phatboyg/1109393 to your computer and use it in GitHub Desktop.
Save phatboyg/1109393 to your computer and use it in GitHub Desktop.
How to stage build actors in an actor chain/network
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