TypedActor
Defined in: src/typed/TypedActor.ts:47
Runtime host for a BehavioronReceive 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.
Extends
Section titled “Extends”Actor<T>
Type Parameters
Section titled “Type Parameters”T
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TypedActor<
T>(initial):TypedActor<T>
Defined in: src/typed/TypedActor.ts:54
Parameters
Section titled “Parameters”initial
Section titled “initial”Behavior<T>
Returns
Section titled “Returns”TypedActor<T>
Overrides
Section titled “Overrides”Methods
Section titled “Methods”onReceive()
Section titled “onReceive()”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.
Parameters
Section titled “Parameters”message
Section titled “message”T
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”postRestart()
Section titled “postRestart()”postRestart(
_reason):void|Promise<void>
Defined in: src/Actor.ts:55
Called on the fresh instance after a restart. Default: call preStart().
Parameters
Section titled “Parameters”_reason
Section titled “_reason”Error
Returns
Section titled “Returns”void | Promise<void>
Inherited from
Section titled “Inherited from”postStop()
Section titled “postStop()”postStop():
void
Defined in: src/typed/TypedActor.ts:98
Called after the actor has been terminated. Children are already stopped.
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”preRestart()
Section titled “preRestart()”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().
Parameters
Section titled “Parameters”reason
Section titled “reason”Error
T
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”preStart()
Section titled “preStart()”preStart():
void
Defined in: src/typed/TypedActor.ts:56
Called after construction and before the first message is processed.
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”supervisorStrategy()
Section titled “supervisorStrategy()”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.