Name what each of the three request paths skips
Test / test (22) (pull_request) Successful in 32s
Test / test (24) (pull_request) Successful in 32s
Mirror / push (push) Has been cancelled
Test / test (26) (pull_request) Successful in 32s
Test / lint (pull_request) Successful in 23s
Test / test (18) (pull_request) Successful in 32s
Test / test (20) (pull_request) Successful in 32s

This commit is contained in:
2026-09-28 10:25:08 +02:00
parent 469a91b9bb
commit b4bb531200
4 changed files with 13 additions and 14 deletions
+10 -7
View File
@@ -81,7 +81,7 @@ export class OutgoingRequests {
this.pending.settle(seqNr, { err });
}
/** Sends a request and resolves with the peer's response. */
/** Sends a request once the gate has a link and the window a slot, and resolves with the peer's response. */
request(input: PduObjectInput, options: SendOptions): Promise<Result<{ pduObj: PduObject }>> {
// Ahead of the drain, so a misuse is named as one rather than blamed on the shutdown.
const wrong = misuse(input);
@@ -93,11 +93,11 @@ export class OutgoingRequests {
return Promise.resolve({ err: new Error('Session is shutting down') });
}
return this.carry(input, options);
return this.requestPastDrain(input, options);
}
/** The same path without the drain's refusal, which a receipt for a held message has to take. */
async carry(
/** request() without the drain's refusal, which a receipt for a held message has to take. */
async requestPastDrain(
input: PduObjectInput,
options: SendOptions,
): Promise<Result<{ pduObj: PduObject }>> {
@@ -109,7 +109,7 @@ export class OutgoingRequests {
if (bindCommands.includes(input.cmdName)) {
const shut = this.gate.refusal();
return shut ? { err: shut } : this.now(input, options);
return shut ? { err: shut } : this.requestPastDrainGateAndWindow(input, options);
}
const waitForLink = this.gate.hold(options.signal);
@@ -129,8 +129,11 @@ export class OutgoingRequests {
}
}
/** Past the gate, the window and a drain, for what has to go out either way. */
async now(input: PduObjectInput, options: SendOptions = {}): Promise<Result<{ pduObj: PduObject }>> {
/** Straight onto the current link, for what has to go out either way. */
async requestPastDrainGateAndWindow(
input: PduObjectInput,
options: SendOptions = {},
): Promise<Result<{ pduObj: PduObject }>> {
return (await this.attempt(input, options)).result;
}