public class ScalaDSL
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ScalaDSL.And<T>
A behavior combinator that feeds incoming messages and signals both into
the left and right sub-behavior and allows them to evolve independently of
each other.
|
static class |
ScalaDSL.And$ |
static class |
ScalaDSL.BehaviorDecorators<T> |
static class |
ScalaDSL.BehaviorDecorators$ |
static class |
ScalaDSL.Deferred<T>
Wrap a behavior factory so that it runs upon PreStart, i.e.
|
static class |
ScalaDSL.Deferred$ |
static class |
ScalaDSL.Full<T>
This type of behavior allows to handle all incoming messages within
the same user-provided partial function, be that a user message or a system
signal.
|
static class |
ScalaDSL.Full$ |
static class |
ScalaDSL.FullTotal<T>
This type of behavior expects a total function that describes the actor’s
reaction to all system signals or user messages, without providing a
fallback mechanism for either.
|
static class |
ScalaDSL.FullTotal$ |
static interface |
ScalaDSL.MessageOrSignal<T>
|
static class |
ScalaDSL.Msg<T>
A message bundled together with the current
ActorContext . |
static class |
ScalaDSL.Msg$ |
static class |
ScalaDSL.Or<T>
A behavior combinator that feeds incoming messages and signals either into
the left or right sub-behavior and allows them to evolve independently of
each other.
|
static class |
ScalaDSL.Or$ |
static class |
ScalaDSL.Partial<T>
This type of Behavior is created from a partial function from the declared
message type to the next behavior, flagging all unmatched messages as
Unhandled() . |
static class |
ScalaDSL.Partial$ |
static class |
ScalaDSL.Sig<T>
A signal bundled together with the current
ActorContext . |
static class |
ScalaDSL.Sig$ |
static class |
ScalaDSL.Static<T>
This type of behavior is a variant of
ScalaDSL.Total that does not
allow the actor to change behavior. |
static class |
ScalaDSL.Static$ |
static class |
ScalaDSL.SynchronousSelf<T>
This behavior allows sending messages to itself without going through the
Actor’s mailbox.
|
static class |
ScalaDSL.SynchronousSelf$ |
static class |
ScalaDSL.Tap<T>
This type of Behavior wraps another Behavior while allowing you to perform
some action upon each received message or signal.
|
static class |
ScalaDSL.Tap$ |
static class |
ScalaDSL.Total<T>
This type of behavior is created from a total function from the declared
message type to the next behavior, which means that all possible incoming
messages for the given type must be handled.
|
static class |
ScalaDSL.Total$ |
static class |
ScalaDSL.Widened<T,U>
Widen the wrapped Behavior by placing a funnel in front of it: the supplied
PartialFunction decides which message to pull in (those that it is defined
at) and may transform the incoming message to place them into the wrapped
Behavior’s type hierarchy.
|
static class |
ScalaDSL.Widened$ |
Constructor and Description |
---|
ScalaDSL() |
Modifier and Type | Method and Description |
---|---|
static scala.Function1<java.lang.Object,Behavior<scala.runtime.Nothing$>> |
_unhandledFunction()
INTERNAL API.
|
static scala.Function1<java.lang.Object,scala.runtime.BoxedUnit> |
_unitFunction()
INTERNAL API.
|
static <T> Behavior<T> |
ContextAware(scala.Function1<ActorContext<T>,Behavior<T>> behavior)
A behavior decorator that extracts the
ActorContext while receiving the
the first signal or message and uses that to construct the real behavior
(which will then also receive that signal or message). |
static <T> Behavior<T> |
Empty()
This behavior does not handle any inputs, it is completely inert.
|
static <T> Behavior<T> |
Ignore()
This behavior does not handle any inputs, it is completely inert.
|
static <T> Behavior<T> |
Same()
Return this behavior from message processing in order to advise the
system to reuse the previous behavior.
|
static <T> Behavior<T> |
SelfAware(scala.Function1<ActorRef<T>,Behavior<T>> behavior)
A behavior decorator that extracts the self
ActorRef while receiving the
the first signal or message and uses that to construct the real behavior
(which will then also receive that signal or message). |
static <T> Behavior<T> |
Stopped()
Return this behavior from message processing to signal that this actor
shall terminate voluntarily.
|
static <T> Behavior<T> |
Unhandled()
Return this behavior from message processing in order to advise the
system to reuse the previous behavior, including the hint that the
message has not been handled.
|
static <T,U> scala.Function1<T,Behavior<U>> |
unhandledFunction()
INTERNAL API.
|
static <T,U> scala.Function1<T,Behavior<U>> |
unitFunction()
INTERNAL API.
|
public static <T> Behavior<T> Same()
public static <T> Behavior<T> Unhandled()
public static <T> Behavior<T> Stopped()
public static <T> Behavior<T> Empty()
public static <T> Behavior<T> Ignore()
public static <T> Behavior<T> SelfAware(scala.Function1<ActorRef<T>,Behavior<T>> behavior)
ActorRef
while receiving the
the first signal or message and uses that to construct the real behavior
(which will then also receive that signal or message).
Example:
SelfAware[MyCommand] { self =>
Simple {
case cmd =>
}
}
This can also be used together with implicitly sender-capturing message types:
final case class OtherMsg(msg: String)(implicit val replyTo: ActorRef[Reply])
SelfAware[MyCommand] { implicit self =>
Simple {
case cmd =>
other ! OtherMsg("hello") // assuming Reply <: MyCommand
}
}
behavior
- (undocumented)public static <T> Behavior<T> ContextAware(scala.Function1<ActorContext<T>,Behavior<T>> behavior)
ActorContext
while receiving the
the first signal or message and uses that to construct the real behavior
(which will then also receive that signal or message).
Example:
ContextAware[MyCommand] { ctx => Simple {
case cmd =>
...
}
}
behavior
- (undocumented)public static scala.Function1<java.lang.Object,Behavior<scala.runtime.Nothing$>> _unhandledFunction()
public static <T,U> scala.Function1<T,Behavior<U>> unhandledFunction()
public static scala.Function1<java.lang.Object,scala.runtime.BoxedUnit> _unitFunction()
public static <T,U> scala.Function1<T,Behavior<U>> unitFunction()