bodhi-realtime-agent / ActorRuntime
Class: ActorRuntime
Defined in: src/runtime/actor-runtime.ts:112
In-process actor runtime.
Manages actor lifecycle, message routing, and mailbox serialization. Integrates with a Supervisor for fault handling (restart/stop/escalate).
Constructors
Constructor
new ActorRuntime():
ActorRuntime
Returns
ActorRuntime
Methods
getMailboxDepth()
getMailboxDepth(
actorId):number
Defined in: src/runtime/actor-runtime.ts:179
Get the mailbox depth for an actor (for observability).
Parameters
actorId
string
Returns
number
hasActor()
hasActor(
actorId):boolean
Defined in: src/runtime/actor-runtime.ts:173
Check if an actor is registered and running.
Parameters
actorId
string
Returns
boolean
send()
send(
envelope):void
Defined in: src/runtime/actor-runtime.ts:145
Send a message to an actor's mailbox.
Parameters
envelope
Returns
void
setSupervisor()
setSupervisor(
supervisor):void
Defined in: src/runtime/actor-runtime.ts:117
Register a supervisor for fault handling.
Parameters
supervisor
Returns
void
startActor()
startActor(
actor):Promise<void>
Defined in: src/runtime/actor-runtime.ts:122
Register and start an actor.
Parameters
actor
Returns
Promise<void>
stopActor()
stopActor(
actorId,reason?):Promise<void>
Defined in: src/runtime/actor-runtime.ts:135
Stop an actor and remove it from the runtime.
Parameters
actorId
string
reason?
string = 'stopped'
Returns
Promise<void>
stopAll()
stopAll(
reason?):Promise<void>
Defined in: src/runtime/actor-runtime.ts:184
Stop all actors in reverse registration order.
Parameters
reason?
string = 'shutdown'
Returns
Promise<void>
tell()
tell<
TType,TPayload>(type,payload,to,options?):void
Defined in: src/runtime/actor-runtime.ts:159
Convenience: create an envelope and send it.
Type Parameters
TType
TType extends string
TPayload
TPayload
Parameters
type
TType
payload
TPayload
to
string
options?
causationId?
string
correlationId?
string
from?
string
Returns
void