Skip to content

Instantly share code, notes, and snippets.

@phatboyg
Created November 10, 2010 16:00
Show Gist options
  • Save phatboyg/671033 to your computer and use it in GitHub Desktop.
Save phatboyg/671033 to your computer and use it in GitHub Desktop.
Examinations on how actors should work
public class CustomerAccount :
Actor
{
string _name;
public void Handle(Message<UpdateName> msg)
{
_name = msg.Name;
}
}
public class Main
{
public void DoSomething()
{
// send a message to the account locator with a query, passing a continuation for the actorInstance returned
_accountLocator.Get(x => x.AccountNumber == "0945210", account =>
{
// account is just an ActorInstance, it has no type/implementation knowledge
account.Send(new UpdateName("Chris"));
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment