Or seems to be useful as an alternative to orElse when lets say in `common` 
you want to handle signals and in `someState` you only want to handle the 
messages.

However this can be handled with the following:

def orElse(b1: Behavior[A]) = new Behavior[A] {
  val unhandled = ScalaDSL.Unhandled[A]
  
  override def management(ctx: ActorContext[A], msg: Signal): Behavior[A] =
    orElse(_.management(ctx, msg))

  override def message(ctx: ActorContext[A], msg: A): Behavior[A] =
    orElse(_.message(ctx, msg))

  private[this] def orElse(f: Behavior[A] => Behavior[A]) = {
    f(b) match {
      case `unhandled` => f(b1)
      case other => other
    }
  }
}


val common = Full[In] { ... }


lazy val notLoggedIn = common orElse Partial[In] { ... }


def loggedIn(user: User): Behavior[In] = common orElse Partial[In] { ... }


.. etc.

On Monday, October 26, 2015 at 1:22:24 PM UTC+2, rkuhn wrote:
>
> Yes, the And and Or combinators are the parts I am least sure of—how 
> useful are they  and how exactly shall they behave? What does that mean for 
> supervision? This is one of the more experimental pieces and I’ll take your 
> feedback as a data point that it might be more trouble than it is worth.
>
> Regards,
>
> Roland
>

-- 
>>>>>>>>>>      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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to