RemoteActorRef
Ce contenu n’est pas encore disponible dans votre langue.
Defined in: src/cluster/RemoteActorRef.ts:17
A ref whose target lives on a different node. tell() builds an envelope
and hands it to the cluster transport. Messages MUST be JSON-safe;
classes are not preserved by default (only the tag string is sent).
Any ActorRef instances embedded in the message body are rewritten to
wire-safe markers inside Cluster._sendEnvelope so they can be
reconstructed on the receiving node.
Extends
Section titled “Extends”ActorRef<TMsg>
Type Parameters
Section titled “Type Parameters”TMsg = unknown
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RemoteActorRef<
TMsg>(targetNode,targetPath,cluster):RemoteActorRef<TMsg>
Defined in: src/cluster/RemoteActorRef.ts:20
Parameters
Section titled “Parameters”targetNode
Section titled “targetNode”targetPath
Section titled “targetPath”string
cluster
Section titled “cluster”Returns
Section titled “Returns”RemoteActorRef<TMsg>
Overrides
Section titled “Overrides”Properties
Section titled “Properties”
readonlypath:ActorPath
Defined in: src/cluster/RemoteActorRef.ts:18
Overrides
Section titled “Overrides”targetNode
Section titled “targetNode”
readonlytargetNode:NodeAddress
Defined in: src/cluster/RemoteActorRef.ts:21
targetPath
Section titled “targetPath”
readonlytargetPath:string
Defined in: src/cluster/RemoteActorRef.ts:22
Methods
Section titled “Methods”ask<
TRes>(message,timeoutMs?):Promise<TRes>
Defined in: src/ActorRef.ts:43
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' });Type Parameters
Section titled “Type Parameters”TRes = unknown
Parameters
Section titled “Parameters”message
Section titled “message”OmitReplyTo<TMsg>
timeoutMs?
Section titled “timeoutMs?”number = 5_000
Returns
Section titled “Returns”Promise<TRes>
Inherited from
Section titled “Inherited from”equals()
Section titled “equals()”equals(
other):boolean
Defined in: src/ActorRef.ts:67
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”kill()
Section titled “kill()”kill():
void
Defined in: src/ActorRef.ts:63
Kill this actor — raises ActorKilledError through the normal supervision path.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”send()
Section titled “send()”send(
message):void
Defined in: src/ActorRef.ts:30
Alias for tell — useful if you want to pipe something.
Parameters
Section titled “Parameters”message
Section titled “message”TMsg
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”stop()
Section titled “stop()”stop():
void
Defined in: src/ActorRef.ts:60
Gracefully stop this actor after it drains its mailbox.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”tell()
Section titled “tell()”tell(
message,sender?):void
Defined in: src/cluster/RemoteActorRef.ts:34
Send a message to this actor. sender is surfaced as context.sender in the recipient.
Parameters
Section titled “Parameters”message
Section titled “message”TMsg
sender?
Section titled “sender?”ActorRef<unknown> | null
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”toString()
Section titled “toString()”toString():
string
Defined in: src/cluster/RemoteActorRef.ts:53
Returns
Section titled “Returns”string