PendingRemoteActorRef
Ce contenu n’est pas encore disponible dans votre langue.
Defined in: src/parallelism/PendingRemoteActorRef.ts:36
The ref system.spawn hands back for an actor that is being created on a
worker (#1563).
spawn stays synchronous and the worker’s acknowledgment does not, so
something has to be returned before the actor exists. Its identity is
settled from the first instant — the path is chosen on the main thread, so
path, equals and toString are what they will be forever — and only
delivery waits: a tell before the acknowledgment is queued in order and
replayed through the real remote ref the moment it arrives, so a caller
that spawns and immediately sends sees exactly the ordering a local spawn
gives. The queue is bounded across the whole extension, with the region
buffer’s vocabulary for overflow: what does not fit goes to dead letters,
never silently away. A spawn the worker refuses, or one that outlives its
deadline, fails the ref the same way — everything queued becomes a dead
letter naming this ref as the recipient, and everything after it too.
Extends
Section titled “Extends”ActorRef<TMessage>
Type Parameters
Section titled “Type Parameters”TMessage
Section titled “TMessage”TMessage = unknown
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PendingRemoteActorRef<
TMessage>(path,system,account):PendingRemoteActorRef<TMessage>
Defined in: src/parallelism/PendingRemoteActorRef.ts:42
Parameters
Section titled “Parameters”system
Section titled “system”account
Section titled “account”PendingBufferAccount
Returns
Section titled “Returns”PendingRemoteActorRef<TMessage>
Overrides
Section titled “Overrides”Properties
Section titled “Properties”
readonlypath:ActorPath
Defined in: src/parallelism/PendingRemoteActorRef.ts:37
Overrides
Section titled “Overrides”Accessors
Section titled “Accessors”isResolved
Section titled “isResolved”Get Signature
Section titled “Get Signature”get isResolved():
boolean
Defined in: src/parallelism/PendingRemoteActorRef.ts:64
Whether delivery has switched to the worker’s actor.
Returns
Section titled “Returns”boolean
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>
Inherited from
Section titled “Inherited from”equals()
Section titled “equals()”equals(
other):boolean
Defined in: src/ActorRef.ts:241
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:237
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: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
Inherited from
Section titled “Inherited from”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
Inherited from
Section titled “Inherited from”tell()
Section titled “tell()”tell(
message,sender?):void
Defined in: src/parallelism/PendingRemoteActorRef.ts:51
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 = null
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”toString()
Section titled “toString()”toString():
string
Defined in: src/parallelism/PendingRemoteActorRef.ts:93
The worker’s rendering once known — node-prefixed, like any remote ref — and the bare path until then.
Returns
Section titled “Returns”string
