Interface StashSupport
- All Known Subinterfaces:
AbstractPersistentActorLike,AsyncWriteProxy,AtLeastOnceDelivery,AtLeastOnceDeliveryLike,Eventsourced,PersistenceStash,PersistentActor,PersistentFSM<S,,D, E> Stash,UnboundedStash,UnrestrictedStash
- All Known Implementing Classes:
AbstractActorWithStash,AbstractActorWithUnboundedStash,AbstractActorWithUnrestrictedStash,AbstractFSMWithStash,AbstractPersistentActor,AbstractPersistentActorWithAtLeastOnceDelivery,AbstractPersistentActorWithTimers,AbstractPersistentFSM,AbstractPersistentLoggingFSM,JournalPerfSpec.BenchActor,PersistencePluginProxy,PersistentShardCoordinator,UntypedAbstractActorWithStash,UntypedAbstractActorWithUnboundedStash,UntypedAbstractActorWithUnrestrictedStash
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.pekko.actor.ActorCellscala.collection.immutable.Vector<Envelope>INTERNAL API.context()voidenqueueFirst(Envelope envelope) Enqueuesenvelopeat the first position in the mailbox.mailbox()voidvoidPrependsothersto this stash.self()voidstash()Adds the current message (the message that the actor received last) to the actor's stash.voidtheStash_$eq(scala.collection.immutable.Vector<Envelope> x$1) voidunstash()Prepends the oldest message in the stash to the mailbox, and then removes that message from the stash.voidPrepends all messages in the stash to the mailbox, and then clears the stash.voidunstashAll(scala.Function1<Object, Object> filterPredicate) INTERNAL API.
-
Method Details
-
actorCell
org.apache.pekko.actor.ActorCell actorCell() -
clearStash
scala.collection.immutable.Vector<Envelope> clearStash()INTERNAL API.Clears the stash and and returns all envelopes that have not been unstashed.
-
context
ActorContext context() -
enqueueFirst
Enqueuesenvelopeat the first position in the mailbox. If the message contained in the envelope is aTerminatedmessage, it will be ensured that it can be re-received by the actor. -
mailbox
DequeBasedMessageQueueSemantics mailbox() -
org$apache$pekko$actor$StashSupport$_setter_$mailbox_$eq
-
prepend
Prependsothersto this stash. This method is optimized for a large stash and smallothers. -
self
ActorRef self() -
stash
void stash()Adds the current message (the message that the actor received last) to the actor's stash.- Throws:
pekko.actor.StashOverflowException- in case of a stash capacity violationIllegalStateException- if the same message is stashed more than once
-
theStash_$eq
-
unstash
void unstash()Prepends the oldest message in the stash to the mailbox, and then removes that message from 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
MessageQueueAppendFailedExceptionis thrown.The unstashed message is guaranteed to be removed from the stash regardless if the
unstash()call successfully returns or throws an exception. -
unstashAll
void unstashAll()Prepends all messages in the stash 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
MessageQueueAppendFailedExceptionis thrown.The stash is guaranteed to be empty after calling
unstashAll(). -
unstashAll
INTERNAL API.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
MessageQueueAppendFailedExceptionis thrown.The stash is guaranteed to be empty after calling
unstashAll(Any => Boolean).- Parameters:
filterPredicate- only stashed messages selected by this predicate are prepended to the mailbox.
-