|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UnrestrictedStash
A version of Stash
that does not enforce any mailbox type. The proper mailbox has to be configured
manually, and the mailbox should extend the DequeBasedMessageQueueSemantics
marker trait.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface akka.actor.Actor |
---|
Actor.emptyBehavior$ |
Method Summary | |
---|---|
akka.actor.ActorCell |
actorCell()
|
int |
capacity()
|
scala.collection.immutable.Vector<Envelope> |
clearStash()
INTERNAL API. |
ActorContext |
context()
INTERNAL API. |
void |
enqueueFirst(Envelope envelope)
Enqueues envelope at the first position in the mailbox. |
DequeBasedMessageQueueSemantics |
mailbox()
INTERNAL API. |
void |
postStop()
Overridden callback. |
void |
prepend(scala.collection.immutable.Seq<Envelope> others)
Prepends others to this stash. |
void |
preRestart(java.lang.Throwable reason,
scala.Option<java.lang.Object> message)
Overridden callback. |
ActorRef |
self()
INTERNAL API. |
void |
stash()
Adds the current message (the message that the actor received last) to the actor's stash. |
scala.collection.immutable.Vector<Envelope> |
theStash()
|
void |
unstash()
Prepends the oldest message in the stash to the mailbox, and then removes that message from the stash. |
void |
unstashAll()
Prepends all messages in the stash to the mailbox, and then clears the stash. |
void |
unstashAll(scala.Function1<java.lang.Object,java.lang.Object> filterPredicate)
INTERNAL API. |
Methods inherited from interface akka.actor.Actor |
---|
aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, noSender, postRestart, preStart, receive, self, sender, supervisorStrategy, unhandled |
Method Detail |
---|
void preRestart(java.lang.Throwable reason, scala.Option<java.lang.Object> message)
preRestart
in interface Actor
reason
- the Throwable that caused the restart to happenmessage
- optionally the current message the actor processed when failing, if applicable
Is called on a crashed Actor right BEFORE it is restarted to allow clean
up of resources before Actor is terminated.void postStop()
postStop
in interface Actor
ActorContext context()
Context of the actor that uses this stash.
ActorRef self()
Self reference of the actor that uses this stash.
scala.collection.immutable.Vector<Envelope> theStash()
akka.actor.ActorCell actorCell()
int capacity()
DequeBasedMessageQueueSemantics mailbox()
The actor's deque-based message queue.
mailbox.queue
is the underlying Deque
.
void stash()
StashOverflowException
- in case of a stash capacity violation
java.lang.IllegalStateException
- if the same message is stashed more than oncevoid prepend(scala.collection.immutable.Seq<Envelope> others)
others
to this stash. This method is optimized for a large stash and
small others
.
void unstash()
Messages from the stash are enqueued to the mailbox until the capacity of the
mailbox (if any) has been reached. In case a bounded mailbox overflows, a
MessageQueueAppendFailedException
is thrown.
The unstashed message is guaranteed to be removed from the stash regardless
if the unstash()
call successfully returns or throws an exception.
void unstashAll()
Messages from the stash are enqueued to the mailbox until the capacity of the
mailbox (if any) has been reached. In case a bounded mailbox overflows, a
MessageQueueAppendFailedException
is thrown.
The stash is guaranteed to be empty after calling unstashAll()
.
void unstashAll(scala.Function1<java.lang.Object,java.lang.Object> filterPredicate)
Prepends selected messages in the stash, applying filterPredicate
, to the
mailbox, and then clears the stash.
Messages from the stash are enqueued to the mailbox until the capacity of the
mailbox (if any) has been reached. In case a bounded mailbox overflows, a
MessageQueueAppendFailedException
is thrown.
The stash is guaranteed to be empty after calling unstashAll(Any => Boolean)
.
filterPredicate
- only stashed messages selected by this predicate are
prepended to the mailbox.scala.collection.immutable.Vector<Envelope> clearStash()
Clears the stash and and returns all envelopes that have not been unstashed.
void enqueueFirst(Envelope envelope)
envelope
at the first position in the mailbox. If the message contained in
the envelope is a Terminated
message, it will be ensured that it can be re-received
by the actor.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |