Prefix for generated correlation ids (e.g. 'p').
Rejection message when the origin closes first.
Rejects a pending request with a reported failure. Ignored when the id is unknown or the failure arrives from a socket other than the request's origin.
The socket the failure arrived on.
The correlation id.
Human-readable failure reason.
Opens a request with a generated id: registers the pending entry and its
close guard, then invokes send with the id to put the request on the
wire.
The socket the request goes to; only it may settle.
Callback that transmits the request, given the new id.
The correlated reply.
With the broker's disconnect reason when the origin closes before answering, or the reason given to fail.
Opens a request under a caller-supplied id, for callers that already correlate ids externally (the remote client's execute/complete counter).
The correlation id to register.
The socket the request goes to; only it may settle.
Callback that transmits the request, given the id.
The correlated reply.
As open.
Whether this origin already has a request in flight.
Some requests may be concurrent and some may not: a surface can render two pipeline segments at once, but it cannot sensibly be asked two questions at once. The broker reports the fact; what to do about it belongs to the caller.
The socket to ask about.
True when a request opened on that socket is still awaiting a reply.
Resolves a pending request with its reply. Ignored when the id is unknown or the reply arrives from a socket other than the request's origin.
The socket the reply arrived on.
The correlation id.
The reply value.
A broker for one kind of correlated request over a WebSocket.
Guarantees, uniformly for every kind: an id unique within the broker, a rejection when the origin socket closes before answering, removal of the close listener once settled (no per-request listener leak), and settles accepted only from the socket the request was sent to (no cross-surface answering).
Example