Optional ReadonlynameOptionalsupervisorConsulted when a failure is escalated. May be assigned after construction.
Settles when the actor has terminated: resolves after a normal stop or kill, rejects with the failure when the actor failed.
The failure that terminated the actor, if any.
Number of messages waiting in the mailbox (including senders blocked on a full mailbox).
Number of restarts so far.
Current state. Replaced on restart.
Enqueues a message and resolves with the handler's return value. Rejects with the handler's error, on timeout, on abort, or if the actor terminates before processing the message.
Terminates immediately: aborts the in-flight handler's signal, drops queued messages as dead letters and rejects their asks. Resolves once the in-flight handler (if any) has settled; idempotent.
Re-initialises the state via init, keeping the mailbox. If a message is in
flight its signal is aborted and the restart happens once the handler
settles; while the failure policy is running (no handler touching the
state) it is applied immediately, so supervisors restarting siblings never
wait on each other.
Rejects if the actor has terminated; if init throws the actor fails with
that error (policy-driven restarts, by contrast, retry through the policy).
Enqueues a message. Resolves once the message is in the mailbox (waiting for room when the mailbox is bounded); rejects if the actor is not running or terminates before accepting it.
Stops accepting messages, processes what is already queued and terminates. Resolves once the actor has terminated (for any reason); idempotent.
An actor owns a piece of state and processes messages from its mailbox one at a time. It starts processing as soon as it is constructed.
Typeparam
M - Message type.
Typeparam
S - State type.
Typeparam
R - Reply type returned by the handler and resolved by ask.