public static final class ScalaDSL.Or<T> extends Behavior<T> implements scala.Product, scala.Serializable
ScalaDSL.Unhandled()
is it passed to the right
sub-behavior. When one of the sub-behaviors terminates the other takes over
exclusively. When both sub-behaviors respond to a Failed
signal, the
response with the higher precedence is chosen (see Failed$
).Behavior.emptyBehavior$, Behavior.ignoreBehavior$, Behavior.sameBehavior$, Behavior.stoppedBehavior$, Behavior.unhandledBehavior$
Constructor and Description |
---|
Or(Behavior<T> left,
Behavior<T> right) |
Modifier and Type | Method and Description |
---|---|
Behavior<T> |
left() |
Behavior<T> |
management(ActorContext<T> ctx,
Signal msg)
Process an incoming
Signal and return the next behavior. |
Behavior<T> |
message(ActorContext<T> ctx,
T msg)
Process an incoming message and return the next behavior.
|
Behavior<T> |
right() |
canonicalize, isAlive, isUnhandled, narrow, preStart, validateAsInitial
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Behavior<T> management(ActorContext<T> ctx, Signal msg)
Behavior
Signal
and return the next behavior. This means
that all lifecycle hooks, ReceiveTimeout, Terminated and Failed messages
can initiate a behavior change.
The returned behavior can in addition to normal behaviors be one of the canned special objects:
* returning Stopped
will terminate this Behavior
* returning Same
designates to reuse the current Behavior
* returning Unhandled
keeps the same Behavior and signals that the message was not yet handled
Code calling this method should use Behavior$
canonicalize
to replace
the special objects with real Behaviors.
management
in class Behavior<T>
ctx
- (undocumented)msg
- (undocumented)public Behavior<T> message(ActorContext<T> ctx, T msg)
Behavior
The returned behavior can in addition to normal behaviors be one of the canned special objects:
* returning Stopped
will terminate this Behavior
* returning Same
designates to reuse the current Behavior
* returning Unhandled
keeps the same Behavior and signals that the message was not yet handled
Code calling this method should use Behavior$
canonicalize
to replace
the special objects with real Behaviors.