Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. class SomeActor extends FSM[State, Data] {
  2. when(Idle) {
  3. case Event(GetChild, _) =>
  4. val child = context.actorOf(Props[ChildActor])
  5. sender() ! child
  6. stay.using(/*save state here*/)
  7.  
  8. val getChildFuture = someRegion ! Message(id, GetChild)
  9. val child: ActorRef = Await.result(getChildFuture, timeout.duration).asInstanceOf[ActorRef]
  10. // do something with the actor ref here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement