Skip to content

Instantly share code, notes, and snippets.

@pjazdzewski1990
Created May 13, 2015 18:38
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 pjazdzewski1990/744f83aefecec59a3222 to your computer and use it in GitHub Desktop.
Save pjazdzewski1990/744f83aefecec59a3222 to your computer and use it in GitHub Desktop.
object FridgeKey extends ServiceKey[FridgeCommand]
val receptionist: ActorRef[Receptionist.Command] = ctx.spawn(Props(Receptionist.behavior), "receptionist")
val human: ActorRef[Receptionist.Listing[FridgeCommand]] = _
val fridge: ActorRef[Receptionist.Registered[FridgeCommand]] = _
receptionist ! Register(key = FridgeKey, address = fridge)(replyTo = fridge)
receptionist ! Find(key = FridgeKey)(replyTo = human)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment