ExchangeRegistry
Defined in: packages/net-core/src/exchange-registry.ts:68
Matches inbound frames against outstanding requests.
This is the seam that decides what correlation strategies a protocol can express. Hard-coding “always the oldest request” — as a naive implementation does — silently rules out every protocol that answers out of order, so the strategy is pluggable from the start.
Type Parameters
Section titled “Type Parameters”In
Key = unknown
Properties
Section titled “Properties”
readonlysize:number
Defined in: packages/net-core/src/exchange-registry.ts:70
Number of exchanges currently outstanding, including tombstones.
Methods
Section titled “Methods”offer()
Section titled “offer()”offer(
frame,body?):boolean
Defined in: packages/net-core/src/exchange-registry.ts:89
Offer an inbound frame to the outstanding exchanges.
Parameters
Section titled “Parameters”In
The decoded frame.
ReadableStream<Uint8Array<ArrayBufferLike>>
Streamed payload declared by the codec, if any.
Returns
Section titled “Returns”boolean
true if an exchange claimed the frame, false if it should be
treated as unsolicited.
register()
Section titled “register()”register(
exchange,key?):void
Defined in: packages/net-core/src/exchange-registry.ts:79
Add an exchange to the set of candidates for inbound frames.
Parameters
Section titled “Parameters”exchange
Section titled “exchange”PendingExchange<In>
The exchange to track.
Key
Correlation key, for registries that match on one. Order-based registries ignore it.
Returns
Section titled “Returns”void
rejectAll()
Section titled “rejectAll()”rejectAll(
error):void
Defined in: packages/net-core/src/exchange-registry.ts:103
Fail every outstanding exchange, for example when the connection drops.
Parameters
Section titled “Parameters”unknown
The reason to reject with.
Returns
Section titled “Returns”void
remove()
Section titled “remove()”remove(
exchange):void
Defined in: packages/net-core/src/exchange-registry.ts:96
Stop tracking an exchange without completing it.
Parameters
Section titled “Parameters”exchange
Section titled “exchange”PendingExchange<In>
The exchange to drop.
Returns
Section titled “Returns”void