Actor class​
Signature:
export declare class Actor<TLogic extends AnyActorLogic> implements ActorRef<EventFromLogic<TLogic>, SnapshotFrom<TLogic>>
Implements: ActorRef<EventFromLogic<TLogic>, SnapshotFrom<TLogic>>
Constructors​
Constructor | Modifiers | Description |
---|---|---|
(constructor)(logic, options) | Creates a new actor instance for the given logic with the provided options, if any. |
Properties​
Property | Modifiers | Type | Description |
---|---|---|---|
_parent? | ActorRef<any, any> | (Optional) | |
clock | Clock | The clock that is responsible for setting and clearing timeouts, such as delayed events and transitions. | |
id | string | The unique identifier for this actor relative to its parent. | |
logic | TLogic | ||
options | Readonly<ActorOptions<TLogic>> | ||
ref | ActorRef<EventFromLogic<TLogic>, SnapshotFrom<TLogic>> | ||
sessionId | string | The globally unique process ID for this invocation. | |
src? | string | (Optional) | |
status | ActorStatus | Whether the service is started. | |
system | ActorSystem<any> |
Methods​
Method | Modifiers | Description |
---|---|---|
[symbolObservable]() | ||
cancel(sendId) | ||
delaySend(params) | ||
getPersistedState() | ||
getSnapshot() | ||
send(event) | Sends an event to the running Actor to trigger a transition. | |
start() | Starts the Actor from the initial state | |
stop() | Stops the Actor and unsubscribe all listeners. | |
subscribe(observer) | ||
subscribe(nextListener, errorListener, completeListener) | ||
toJSON() |