ExchangeOptions
ExchangeOptions<
In,Key> =object
Defined in: packages/net-core/src/exchange-registry.ts:23
Options accepted by every request-issuing session method.
Type Parameters
Section titled “Type Parameters”In
Key = unknown
Properties
Section titled “Properties”abortPolicy?
Section titled “abortPolicy?”
optionalabortPolicy?:AbortPolicy
Defined in: packages/net-core/src/exchange-registry.ts:47
Defaults to discard.
optionalkey?: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.
onBody?
Section titled “onBody?”
optionalonBody?: (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.
Parameters
Section titled “Parameters”In
ReadableStream<Uint8Array>
Returns
Section titled “Returns”void
signal?
Section titled “signal?”
optionalsignal?: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.
timeoutMs?
Section titled “timeoutMs?”
optionaltimeoutMs?: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.