ActorOptionsType
Ce contenu n’est pas encore disponible dans votre langue.
ActorOptionsType<
TMessage> =object
Defined in: src/ActorOptions.ts:44
Plain options-object shape accepted wherever an actor is spawned.
Type Parameters
Section titled “Type Parameters”TMessage
Section titled “TMessage”TMessage = unknown
Properties
Section titled “Properties”dispatcher?
Section titled “dispatcher?”
readonlyoptionaldispatcher?:Dispatcher
Defined in: src/ActorOptions.ts:53
Run this actor on a different dispatcher than the system’s.
displayName?
Section titled “displayName?”
readonlyoptionaldisplayName?:string
Defined in: src/ActorOptions.ts:100
Human-readable name for log lines and the DevTools tree (#891) — the
spawn-site counterpart to overriding Actor.displayName(), for a
framework-constructed actor with no subclass of your own: a Behaviors
actor, a sharded entity, a singleton.
Outranks the method, exactly as supervisorStrategy outranks
Actor.supervisorStrategy(). Purely cosmetic — the path stays the
identity everywhere that routes or correlates.
entity?
Section titled “entity?”
readonlyoptionalentity?:EntityContext
Defined in: src/ActorOptions.ts:110
Spawn this actor as a sharded entity with the given identity, readable
back off this.entityId / this.context.entity.
ClusterSharding sets this itself for every entity a shard creates. It
is public for the test bench: an entity that derives its persistenceId
from this.entityId is otherwise unspawnable without a cluster standing
behind it.
internal?
Section titled “internal?”
readonlyoptionalinternal?:boolean
Defined in: src/ActorOptions.ts:89
This actor belongs to the tooling, not to the application.
Whole-system instrumentation skips it, which is what keeps a debugger from observing itself: DevTools’ own hub publishes the spans it just recorded, so tracing it feeds its own output back in. Children inherit the mark — a tooling actor’s children are tooling.
mailbox?
Section titled “mailbox?”
readonlyoptionalmailbox?:MailboxFactory<TMessage>
Defined in: src/ActorOptions.ts:80
Custom mailbox — PriorityMailbox, or a BoundedMailbox configured
beyond what mailboxCapacity / mailboxOverflow express, or a
Mailbox subclass of your own. Omit for the default unbounded FIFO
queue.
Drops still reach actor_mailbox_dropped_total: the cell registers its
observer on whatever you return, provided the mailbox implements
DropReportingMailbox (BoundedMailbox does). Any onDrop of your own
keeps firing alongside it.
mailboxCapacity?
Section titled “mailboxCapacity?”
readonlyoptionalmailboxCapacity?:number
Defined in: src/ActorOptions.ts:61
Bound this actor’s mailbox at mailboxCapacity queued user messages.
Unset means unbounded, which is the default — so setting this is the
act that introduces message loss, and mailboxOverflow decides
which message is lost. Cannot be combined with mailbox, which brings
its own bound.
mailboxOverflow?
Section titled “mailboxOverflow?”
readonlyoptionalmailboxOverflow?:BoundedMailboxOverflow
Defined in: src/ActorOptions.ts:68
What a full mailbox does with an arriving message. Only meaningful together with mailboxCapacity — an unbounded mailbox is never full — so setting it alone is rejected rather than silently ignored. Defaults to DEFAULT_MAILBOX_OVERFLOW.
supervisorStrategy?
Section titled “supervisorStrategy?”
readonlyoptionalsupervisorStrategy?:SupervisorStrategy
Defined in: src/ActorOptions.ts:51
How the parent handles this actor’s failures. Distinct from the
supervisorStrategy() override inside the actor class, which governs its
children. Set here, a single child opts out of its parent’s policy
without affecting its siblings.
