Skip to content

TypedActor

Defined in: src/typed/TypedActor.ts:47

Runtime host for a Behavior. Bridges the typed DSL to the OO Actor — the actor’s onReceive delegates into whichever Behavior is currently active, and transitions follow whatever the handler returns.

The class is internal; users create actors via spawn(behavior) on the typed context or typedProps(behavior) at the system level.

T

new TypedActor<T>(initial): TypedActor<T>

Defined in: src/typed/TypedActor.ts:54

Behavior<T>

TypedActor<T>

Actor.constructor

onReceive(message): void

Defined in: src/typed/TypedActor.ts:65

Main message handler. Receives each envelope dequeued from the mailbox. A thrown error (sync or async) is caught by the supervisor.

T

void

Actor.onReceive


postRestart(_reason): void | Promise<void>

Defined in: src/Actor.ts:55

Called on the fresh instance after a restart. Default: call preStart().

Error

void | Promise<void>

Actor.postRestart


postStop(): void

Defined in: src/typed/TypedActor.ts:98

Called after the actor has been terminated. Children are already stopped.

void

Actor.postStop


preRestart(reason, _msg?): void

Defined in: src/typed/TypedActor.ts:107

Called before a restart, on the instance about to be thrown away. The default stops children and then calls postStop().

Error

T

void

Actor.preRestart


preStart(): void

Defined in: src/typed/TypedActor.ts:56

Called after construction and before the first message is processed.

void

Actor.preStart


supervisorStrategy(): SupervisorStrategy

Defined in: src/Actor.ts:63

Supervisor strategy for this actor’s children. Defaults to restart, up to 10 times per minute, then stop.

SupervisorStrategy

Actor.supervisorStrategy