Skip to content

Instantly share code, notes, and snippets.

@alexandru
Created October 31, 2014 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexandru/63eebe8e49e796f31e73 to your computer and use it in GitHub Desktop.
Save alexandru/63eebe8e49e796f31e73 to your computer and use it in GitHub Desktop.
class AccountActor extends Actor {
def receive = initializing
def initializing: Receive = {
case account: AccountDetails =>
context.become(active(account))
}
def active(account: AccountDetails): Receive = {
case update: AccountDetails =>
logger.info("Account details have been updated")
context.become(active(account))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment