StashBuffer
Esta página aún no está disponible en tu idioma.
Defined in: src/typed/Behavior.ts:121
Lightweight stash interface handed to Behaviors.withStash factories.
Not a wrapper over context.stash() — it holds its own buffer, because
stash(message) takes any value where the OO call can only park the
message being handled, and because the capacity is declared per behavior
where the cell’s is one default for the whole actor. It nonetheless gives
the same guarantees the OO stash does: FIFO order, a capacity bound with a
StashOverflowError past it, replay ahead of anything already queued,
and dead letters for whatever is still parked when the actor stops or
restarts (#639). The one thing it cannot reproduce is the original sender
on those dead letters, since the buffer holds bare messages.
Type Parameters
Section titled “Type Parameters”T
Properties
Section titled “Properties”isEmpty
Section titled “isEmpty”
readonlyisEmpty:boolean
Defined in: src/typed/Behavior.ts:131
True if the buffer holds any message.
isFull
Section titled “isFull”
readonlyisFull:boolean
Defined in: src/typed/Behavior.ts:133
True if the buffer is at capacity.
readonlysize:number
Defined in: src/typed/Behavior.ts:135
Current number of stashed messages.
Methods
Section titled “Methods”stash()
Section titled “stash()”stash(
message):void
Defined in: src/typed/Behavior.ts:123
Stash the current message; must be called during a user message.
Parameters
Section titled “Parameters”message
Section titled “message”T
Returns
Section titled “Returns”void
unstashAll()
Section titled “unstashAll()”unstashAll():
void
Defined in: src/typed/Behavior.ts:129
Replay the buffered messages, prepended to the user mailbox in the order they were stashed — so they are handled before anything that was already queued when this was called. The buffer is empty afterwards.
Returns
Section titled “Returns”void
