ClusterClient
此内容尚不支持你的语言。
Defined in: src/cluster/ClusterClient.ts:119
Connect to a cluster via one of the listed contact-points and exchange messages with actors on the cluster. See the file header for scope.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ClusterClient(
options):ClusterClient
Defined in: src/cluster/ClusterClient.ts:136
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”ClusterClient
Accessors
Section titled “Accessors”clientAddress
Section titled “clientAddress”Get Signature
Section titled “Get Signature”get clientAddress():
NodeAddress
Defined in: src/cluster/ClusterClient.ts:156
The synthetic identity this client uses in its hello handshake.
Returns
Section titled “Returns”Methods
Section titled “Methods”ask<
R>(targetPath,message,timeoutMs?):Promise<R>
Defined in: src/cluster/ClusterClient.ts:181
Send a message and wait for a reply. Resolves with the reply body on success, rejects with an Error on path-not-found / timeout / cluster-side ask failure.
Type Parameters
Section titled “Type Parameters”R = unknown
Parameters
Section titled “Parameters”targetPath
Section titled “targetPath”string
message
Section titled “message”unknown
timeoutMs?
Section titled “timeoutMs?”number
Returns
Section titled “Returns”Promise<R>
close()
Section titled “close()”close():
Promise<void>
Defined in: src/cluster/ClusterClient.ts:216
Close the connection. Idempotent.
Returns
Section titled “Returns”Promise<void>
send()
Section titled “send()”send(
targetPath,message):Promise<void>
Defined in: src/cluster/ClusterClient.ts:165
Fire-and-forget tell to the actor at targetPath on the cluster.
targetPath accepts the same shapes as ActorSystem.actorSelection:
full URI, absolute path, or relative-to-/user. A path starting with
system/ addresses a framework actor — e.g.
'system/cluster/receptionist'.
Parameters
Section titled “Parameters”targetPath
Section titled “targetPath”string
message
Section titled “message”unknown
Returns
Section titled “Returns”Promise<void>
