Skip to content

ExchangeOptions

ExchangeOptions<In, Key> = object

Defined in: packages/net-core/src/exchange-registry.ts:23

Options accepted by every request-issuing session method.

In

Key = unknown

optional abortPolicy?: AbortPolicy

Defined in: packages/net-core/src/exchange-registry.ts:47

Defaults to discard.


optional key?: Key

Defined in: packages/net-core/src/exchange-registry.ts:30

Correlation key the peer will echo in its response.

Required when the session uses a KeyedRegistry and ignored otherwise, since order-based registries derive correlation from position.


optional onBody?: (frame, body) => void

Defined in: packages/net-core/src/exchange-registry.ts:57

Receives the streamed payload of a response frame, if the codec declared one.

Delivered as soon as the frame is decoded rather than when the exchange completes, so a consumer can start draining an HTTP response body while its trailers are still arriving.

In

ReadableStream<Uint8Array>

void


optional signal?: AbortSignal

Defined in: packages/net-core/src/exchange-registry.ts:37

Abandons the exchange when it fires. Combine with ExchangeOptions.abortPolicy to control what happens to the response that is already in flight.


optional timeoutMs?: number

Defined in: packages/net-core/src/exchange-registry.ts:44

Abandons the exchange after this many milliseconds. A convenience over building an AbortSignal.timeout, and the reason signal exists for most callers.