Skip to content

ask

ask<TReq, TRes>(target, message, timeoutMs?): Promise<TRes>

Defined in: src/Ask.ts:15

Request/response pattern. Sends message to target, attaching a temporary sender ref. The returned Promise resolves with the first reply or rejects with AskTimeoutError after timeoutMs.

Inside the recipient, reply with context.sender?.tell(response).

Tip: a recipient can reject an ask by replying with an Error instance.

TReq

TRes = unknown

ActorRef<TReq>

TReq

number = 5_000

Promise<TRes>