ActorRef
Это содержимое пока не доступно на вашем языке.
Defined in: src/ActorRef.ts:118
Handle to an actor. The only way to interact with an actor — you never hold a direct reference to the Actor instance itself. tell() is fire-and- forget; ask() provides a request/response Promise.
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”TMessage
Section titled “TMessage”TMessage = unknown
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ActorRef<
TMessage>():ActorRef<TMessage>
Returns
Section titled “Returns”ActorRef<TMessage>
Properties
Section titled “Properties”
abstractreadonlypath:ActorPath
Defined in: src/ActorRef.ts:119
Methods
Section titled “Methods”ask<
TResponse>(message,timeoutMs?):Promise<TResponse>
Defined in: src/ActorRef.ts:145
Request/response — send message and await the recipient’s reply.
The framework synthesises a one-shot reply ref, injects it as both
the sender slot and as message.replyTo, and resolves the returned
promise with the first reply (or rejects with AskTimeoutError).
The caller never specifies replyTo on the message — the OmitReplyTo
type subtracts it from the parameter type if the recipient declares it.
const value = await counter.ask<number>({ kind: 'get' });timeoutMs must be a positive finite number; omit it (or pass
undefined) to get ActorRef._defaultAskTimeoutMs — the configured
actor-ts.actor.ask-timeout on a ref that can reach its ActorSystem,
and DEFAULT_ASK_TIMEOUT_MS on one that cannot. 0, a negative
value, NaN and Infinity throw OptionsError — see
assertAskTimeout for why an ask has no “no deadline” mode.
Type Parameters
Section titled “Type Parameters”TResponse
Section titled “TResponse”TResponse = unknown
Parameters
Section titled “Parameters”message
Section titled “message”OmitReplyTo<TMessage>
timeoutMs?
Section titled “timeoutMs?”number
Returns
Section titled “Returns”Promise<TResponse>
equals()
Section titled “equals()”equals(
other):boolean
Defined in: src/ActorRef.ts:241
Parameters
Section titled “Parameters”ActorRef
Returns
Section titled “Returns”boolean
kill()
Section titled “kill()”kill():
void
Defined in: src/ActorRef.ts:237
Kill this actor — raises ActorKilledError through the normal supervision path.
Returns
Section titled “Returns”void
send()
Section titled “send()”send(
message):void
Defined in: src/ActorRef.ts:125
Alias for tell — useful if you want to pipe something.
Parameters
Section titled “Parameters”message
Section titled “message”TMessage
Returns
Section titled “Returns”void
stop()
Section titled “stop()”stop():
void
Defined in: src/ActorRef.ts:234
Gracefully stop this actor after it drains its mailbox.
Returns
Section titled “Returns”void
tell()
Section titled “tell()”
abstracttell(message,sender?):void
Defined in: src/ActorRef.ts:122
Send a message to this actor. sender is surfaced as context.sender in the recipient.
Parameters
Section titled “Parameters”message
Section titled “message”TMessage
sender?
Section titled “sender?”ActorRef<unknown> | null
Returns
Section titled “Returns”void
toString()
Section titled “toString()”toString():
string
Defined in: src/ActorRef.ts:239
Returns
Section titled “Returns”string
