There are no collections in the pattern matching.

var subrClients = Map.empty[SessionId,SerializedActorPath]

val receiveRecover: Receive = {
  case ClientRegistered(sessId, actor)    ⇒ subrClients += sessId -> actor
  case ClientDeRegistered(sessId)         ⇒ subrClients = subrClients.
filterNot(_._1 == sessId)
}

val receiveCommand: Receive = {
    case c @ RegisterClient(sbrId, sessId) ⇒
      getActorRef(sessId) match {
        case Some(a)                    ⇒
          a ! ClientRegisteredWithNewActor(sender)
          register(sessId, sender)
        case None                       ⇒
          register(sessId, sender)
      }      
}


The ClientDeRegistered event isn't the result of a command, but is 
persisted when this method executes, immediately after actor startup.

  def checkAndDeRegisterNonLiveSubrClients {
    subrClients.foreach { sc ⇒
      getActorRef(sc._1).foreach { ar ⇒
        performIfActorNotLive(ar, persistAndUpdate(ClientDeRegistered(sc._1
)))
      }
    }
  }



-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to