Skip to content

Instantly share code, notes, and snippets.

@pjazdzewski1990
Created May 15, 2015 11:43
Show Gist options
  • Save pjazdzewski1990/a245ee3a5ff78feff836 to your computer and use it in GitHub Desktop.
Save pjazdzewski1990/a245ee3a5ff78feff836 to your computer and use it in GitHub Desktop.
class CreateGameRequestActor extends Actor {
gameManager ! GameManager.CreateGame
context.setReceiveTimeout(timeout)
override def receive = {
case GameManager.GameCreated(id) =>
ctx.complete(StatusCodes.Created, CreateGameResponseData(id.value))
context stop self
case ReceiveTimeout =>
ctx.complete(StatusCodes.RequestTimeout)
context stop self
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment