Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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