ClusterSingletonProxy
Esta página aún no está disponible en tu idioma.
Defined in: src/cluster/singleton/ClusterSingletonProxy.ts:20
Location-transparent handle to a cluster-wide singleton. Every call to
tell looks up the current leader and forwards to that node’s
ClusterSingletonManager (via direct tell if local, via envelope if
remote). Messages sent before the cluster has elected a leader are
buffered and drained when the first LeaderChanged event fires.
The proxy extends ActorRef
Extends
Section titled “Extends”ActorRef<T>
Type Parameters
Section titled “Type Parameters”T
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ClusterSingletonProxy<
T>(cluster,typeName,localManagerRef):ClusterSingletonProxy<T>
Defined in: src/cluster/singleton/ClusterSingletonProxy.ts:26
Parameters
Section titled “Parameters”cluster
Section titled “cluster”typeName
Section titled “typeName”string
localManagerRef
Section titled “localManagerRef”Returns
Section titled “Returns”ClusterSingletonProxy<T>
Overrides
Section titled “Overrides”Properties
Section titled “Properties”
readonlypath:ActorPath
Defined in: src/cluster/singleton/ClusterSingletonProxy.ts:21
Overrides
Section titled “Overrides”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<T>
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”hasPending()
Section titled “hasPending()”hasPending():
boolean
Defined in: src/cluster/singleton/ClusterSingletonProxy.ts:61
True if at least one message is currently buffered.
Returns
Section titled “Returns”boolean
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”T
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”stop()
Section titled “stop()”stop():
void
Defined in: src/cluster/singleton/ClusterSingletonProxy.ts:54
Stop forwarding; unsubscribes from cluster events.
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”tell()
Section titled “tell()”tell(
message,_sender?):void
Defined in: src/cluster/singleton/ClusterSingletonProxy.ts:43
Send a message to this actor. sender is surfaced as context.sender in the recipient.
Parameters
Section titled “Parameters”message
Section titled “message”T
_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/ActorRef.ts:65
Returns
Section titled “Returns”string