implicit class BehaviorExts[A](val b: Behavior[A]) extends AnyVal {
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
}
}
}
}
It got cut off somehow :)
When I think about it, when I used Or I intuitively expected it to work like
this.
--
>>>>>>>>>> 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.