Created
November 10, 2010 16:00
-
-
Save phatboyg/671033 to your computer and use it in GitHub Desktop.
Examinations on how actors should work
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 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