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
public interface StashSupport
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.apache.pekko.actor.ActorCellactorCell()scala.collection.immutable.Vector<Envelope>clearStash()INTERNAL API.ActorContextcontext()voidenqueueFirst(Envelope envelope)Enqueuesenvelopeat the first position in the mailbox.DequeBasedMessageQueueSemanticsmailbox()voidorg$apache$pekko$actor$StashSupport$_setter_$mailbox_$eq(DequeBasedMessageQueueSemantics x$1)voidprepend(scala.collection.immutable.Seq<Envelope> others)Prependsothersto this stash.ActorRefself()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.voidunstashAll()Prepends all messages in the stash to the mailbox, and then clears the stash.voidunstashAll(scala.Function1<java.lang.Object,java.lang.Object> filterPredicate)INTERNAL API.
-
-
-
Method Detail
-
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
void enqueueFirst(Envelope envelope)
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
void org$apache$pekko$actor$StashSupport$_setter_$mailbox_$eq(DequeBasedMessageQueueSemantics x$1)
-
prepend
void prepend(scala.collection.immutable.Seq<Envelope> others)
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 violationjava.lang.IllegalStateException- if the same message is stashed more than once
-
theStash_$eq
void theStash_$eq(scala.collection.immutable.Vector<Envelope> x$1)
-
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
void unstashAll(scala.Function1<java.lang.Object,java.lang.Object> filterPredicate)
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.
-
-