Skip to content

PendingExchange

Defined in: packages/net-core/src/pending-exchange.ts:24

One outstanding request awaiting its response frames.

Created by a session and held by an ExchangeRegistry until it completes, is abandoned, or the connection fails.

In

new PendingExchange<In>(accept, resolve, reject, onBody?): PendingExchange<In>

Defined in: packages/net-core/src/pending-exchange.ts:38

ExchangeAccept<In>

(frames) => void

(error) => void

(frame, body) => void

PendingExchange<In>

readonly accept: ExchangeAccept<In>

Defined in: packages/net-core/src/pending-exchange.ts:39


readonly frames: In[] = []

Defined in: packages/net-core/src/pending-exchange.ts:26

Frames accepted so far, in arrival order.


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

Defined in: packages/net-core/src/pending-exchange.ts:42

In

ReadableStream<Uint8Array<ArrayBufferLike>>

void


orphaned: boolean = false

Defined in: packages/net-core/src/pending-exchange.ts:34

Set when the caller abandoned the exchange under the discard policy.

The exchange stays registered so it can absorb the response that is still in flight, but its result is thrown away instead of delivered.

get isSettled(): boolean

Defined in: packages/net-core/src/pending-exchange.ts:46

Whether this exchange has already resolved or rejected.

boolean

complete(): void

Defined in: packages/net-core/src/pending-exchange.ts:51

Deliver the collected frames, unless the exchange was orphaned.

void


fail(error): void

Defined in: packages/net-core/src/pending-exchange.ts:66

Fail the exchange.

Error

The reason to reject with.

void