Type alias because traits cannot have companion objects.
Type alias because traits cannot have companion objects.
Adds the listener
this this registry's listener list.
Adds the listener
this this registry's listener list.
The listener
is started by this method if manageLifeCycleOfListeners yields true.
Changes the Actor's behavior to become the new 'Receive' (PartialFunction[Any, Unit]) handler.
Changes the Actor's behavior to become the new 'Receive' (PartialFunction[Any, Unit]) handler. Puts the behavior on top of the hotswap stack. If "discardOld" is true, an unbecome will be issued prior to pushing the new behavior to the stack
Cancel named timer, ensuring that the message is not subsequently delivered (no race).
Execute f
with each listener as argument.
Execute f
with each listener as argument. ActorInitializationException is not handled.
User overridable callback.
User overridable callback.
Is called on the crashed Actor to give it the option of producing the Actor's reincarnation. If it returns None, which is the default, the initially provided actor factory is used.
Warning: Propagating state from a crashed actor carries the risk of proliferating the cause of the error. Consider let-it-crash first.
Produce transition to other state.
Produce transition to other state. Return this from a state function in order to effect the transition.
state designator for the next state
state transition descriptor
Checks if a specific listener is registered.
Checks if a specific listener is registered. ActorInitializationException leads to removal of listener if that one isShutdown.
Verify existence of initial state and setup timers.
Verify existence of initial state and setup timers. This should be the last call within the constructor.
Is the actor able to handle the message passed in as arguments?
Is the actor able to handle the message passed in as arguments?
Specifies whether listeners should be started when added and stopped when removed or not
Specifies whether listeners should be started when added and stopped when removed or not
Return next state data (available in onTransition handlers)
Set handler which is called upon termination of this FSM actor.
Set handler which is called upon termination of this FSM actor.
Set handler which is called upon each state transition, i.
Set handler which is called upon each state transition, i.e. not when staying in the same state. This may use the pair extractor defined in the FSM companion object like so:
onTransition { case Old -> New => doSomething }
It is also possible to supply a 2-ary function object:
onTransition(handler _) private def handler(from: S, to: S) { ... }
The underscore is unfortunately necessary to enable the nicer syntax shown above (it uses the implicit conversion total2pf under the hood).
Multiple handlers may be installed, and every one of them will be called, not only the first one matching.
Option[ActorRef] representation of the 'self' ActorRef reference.
Option[ActorRef] representation of the 'self' ActorRef reference.
Mainly for internal use, functions as the implicit sender references when invoking one of the message send functions ('!', '!!' and '!!!').
User overridable callback.
User overridable callback.
Is called right AFTER restart on the newly created Actor to allow reinitialization after an Actor crash.
User overridable callback.
User overridable callback.
Is called on a crashed Actor right BEFORE it is restarted to allow clean up of resources before Actor is terminated. Override either the variant with or without the currentMessage argument.
User overridable callback.
User overridable callback.
Is called when an Actor is started by invoking 'actor.start()'.
******************************************* Main actor receive() method *******************************************
******************************************* Main actor receive() method *******************************************
Removes the listener
this this registry's listener list.
Removes the listener
this this registry's listener list.
The listener
is stopped by this method if manageLifeCycleOfListeners yields true.
The 'self' field holds the ActorRef for this actor.
The 'self' field holds the ActorRef for this actor.
Can be used to send messages to itself:
self ! messageHere you also find most of the Actor API.
For example fields like:
self.dispatcher = ... self.trapExit = ... self.faultHandler = ... self.lifeCycle = ... self.sender
Here you also find methods like:
self.reply(..) self.link(..) self.unlink(..) self.start(..) self.stop(..)
Set state timeout explicitly.
Set state timeout explicitly. This method can safely be used from within a state handler.
Schedule named timer to deliver message after given delay, possibly repeating.
Schedule named timer to deliver message after given delay, possibly repeating.
identifier to be used with cancelTimer()
message to be delivered
delay of first message delivery and between subsequent messages
send once if false, scheduleAtFixedRate if true
current state descriptor
Some[ActorRef] representation of the 'self' ActorRef reference.
Some[ActorRef] representation of the 'self' ActorRef reference.
Mainly for internal use, functions as the implicit sender references when invoking the 'forward' function.
Set initial state.
Set initial state. Call this method from the constructor before the #initialize method.
initial state designator
initial state data
state timeout for the initial state, overriding the default timeout for that state
Return current state data (i.
Return current state name (i.
Produce "empty" transition descriptor.
Produce "empty" transition descriptor. Return this from a state function when no state change is to be effected.
descriptor for staying in current state
Produce change descriptor to stop this FSM actor including specified reason.
Produce change descriptor to stop this FSM actor including specified reason.
Produce change descriptor to stop this FSM actor including specified reason.
Produce change descriptor to stop this FSM actor including specified reason.
Produce change descriptor to stop this FSM actor with reason "Normal".
Produce change descriptor to stop this FSM actor with reason "Normal".
Inquire whether the named timer is still active.
Convenience wrapper for using a total function instead of a partial function literal.
Convenience wrapper for using a total function instead of a partial function literal. To be used with onTransition.
Reverts the Actor behavior to the previous one in the hotswap stack.
Reverts the Actor behavior to the previous one in the hotswap stack.
User overridable callback.
User overridable callback.
Is called when a message isn't handled by the current behavior of the actor by default it throws an UnhandledMessageException
Insert a new StateFunction at the end of the processing chain for the given state.
Insert a new StateFunction at the end of the processing chain for the given state. If the stateTimeout parameter is set, entering this state without a differing explicit timeout setting will trigger a StateTimeout event; the same is true when using #stay.
designator for the state
default state timeout for this state
partial function describing response to input
Set handler which is called upon reception of unhandled messages.
Set handler which is called upon reception of unhandled messages.
User overridable callback.
User overridable callback.
Is called on a crashed Actor right BEFORE it is restarted to allow clean up of resources before Actor is terminated. Override either the variant with or without the currentMessage argument.
This method is deprecated: use the variant which receives the current message instead. This method will be removed in version 2.0.
use two-argument version, this one will be removed in 2.0