Answer method. Register it once — a second live handler makes the caller settle
on whichever reply lands first.
The reply is addressed to the caller automatically. Throw RequestError to
send a message the caller can read; any other throw becomes internal_error.
an unsubscribe function
Call method and resolve with the handler's response.
Rejects with a RequestError carrying the handler's message when it failed, or with a RequestTimeoutError when no reply arrived in time.
Custom events are not chunked, so a request or response must fit one comms message
(~12KB). An oversized or unserializable payload rejects immediately with
payload_too_large / invalid_payload rather than waiting out the timeout.
Optional options: RequestOptions
Answer
method. Register it once — a second live handler makes the caller settle on whichever reply lands first.The reply is addressed to the caller automatically. Throw RequestError to send a message the caller can read; any other throw becomes
internal_error.Returns
an unsubscribe function