abstract class Behavior[T] extends AnyRef
The behavior of an actor defines how it reacts to the messages that it receives. The message may either be of the type that the Actor declares and which is part of the ActorRef signature, or it may be a system Signal that expresses a lifecycle event of either this actor or one of its child actors.
Behaviors can be formulated in a number of different ways, either by creating a derived class or by employing factory methods like the ones in the ScalaDSL$ object.
- Source
- Behavior.scala
- Alphabetic
- By Inheritance
- Behavior
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Behavior()
Abstract Value Members
-
abstract
def
management(ctx: ActorContext[T], msg: Signal): Behavior[T]
Process an incoming Signal and return the next behavior.
Process an incoming 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 * returningSame
designates to reuse the current Behavior * returningUnhandled
keeps the same Behavior and signals that the message was not yet handledCode calling this method should use Behavior$
canonicalize
to replace the special objects with real Behaviors. -
abstract
def
message(ctx: ActorContext[T], msg: T): Behavior[T]
Process an incoming message and return the next behavior.
Process an incoming message and return the next behavior.
The returned behavior can in addition to normal behaviors be one of the canned special objects:
* returning
Stopped
will terminate this Behavior * returningSame
designates to reuse the current Behavior * returningUnhandled
keeps the same Behavior and signals that the message was not yet handledCode calling this method should use Behavior$
canonicalize
to replace the special objects with real Behaviors.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Behavior[T], B)
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- def ensuring(cond: (Behavior[T]) ⇒ Boolean, msg: ⇒ Any): Behavior[T]
- def ensuring(cond: (Behavior[T]) ⇒ Boolean): Behavior[T]
- def ensuring(cond: Boolean, msg: ⇒ Any): Behavior[T]
- def ensuring(cond: Boolean): Behavior[T]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def formatted(fmtstr: String): String
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
narrow[U <: T]: Behavior[U]
Narrow the type of this Behavior, which is always a safe operation.
Narrow the type of this Behavior, which is always a safe operation. This method is necessary to implement the contravariant nature of Behavior (which cannot be expressed directly due to type inference problems).
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- def →[B](y: B): (Behavior[T], B)