Re-wrap the shutdown paragraph and leave the throw-versus-rejection note in one place
This commit is contained in:
@@ -332,13 +332,13 @@ TypeScript users can import `SmppLog` to have the compiler check one.
|
|||||||
`sendSms()`, `send()`, `sendReturn()`, `unbind()` and `close()`. Both `close()` and `unbind()`
|
`sendSms()`, `send()`, `sendReturn()`, `unbind()` and `close()`. Both `close()` and `unbind()`
|
||||||
refuse further sends, wait out the requests this end already sent for up to `shutdownTimeout`, and
|
refuse further sends, wait out the requests this end already sent for up to `shutdownTimeout`, and
|
||||||
then tear down whatever is left, resolving to an `err` that says what was lost. They also wait for
|
then tear down whatever is left, resolving to an `err` that says what was lost. They also wait for
|
||||||
every `sms` still in the application's hands, so a peer whose `submit_sm` is
|
every `sms` still in the application's hands, so a peer whose `submit_sm` is being handled is
|
||||||
being handled is answered rather than left to re-send it. That wait ends when `sendResp()` puts the
|
answered rather than left to re-send it. That wait ends when `sendResp()` puts the response on the
|
||||||
response on the wire, or when every listener that took the message has failed; answering its PDUs
|
wire, or when every listener that took the message has failed; answering its PDUs through
|
||||||
through `sendReturn()` instead leaves the wait running until it gives up. `sendDlr()` is the one send the refusal lets
|
`sendReturn()` instead leaves the wait running until it gives up. `sendDlr()` is the one send the
|
||||||
past, and it catches the wait when issued straight after `sendResp()`; await anything in between and
|
refusal lets past, and it catches the wait when issued straight after `sendResp()`; await anything in
|
||||||
it races the shutdown like any other send. `close({ signal })` takes an
|
between and it races the shutdown like any other send. `close({ signal })` takes an `AbortSignal`
|
||||||
`AbortSignal` that cuts the wait short; `unbind()` takes none, and waits a further
|
that cuts the wait short; `unbind()` takes none, and waits a further
|
||||||
`responseTimeout` for its own response. `send()` reaches any of the 33 SMPP commands the codec
|
`responseTimeout` for its own response. `send()` reaches any of the 33 SMPP commands the codec
|
||||||
knows, not just the four the session handles natively:
|
knows, not just the four the session handles natively:
|
||||||
|
|
||||||
|
|||||||
@@ -1456,7 +1456,6 @@ describe('graceful shutdown', () => {
|
|||||||
assert.ok((await sent).err instanceof Error);
|
assert.ok((await sent).err instanceof Error);
|
||||||
});
|
});
|
||||||
|
|
||||||
// A rejection leaves the other listeners running, unlike a throw, which stops emit() where it is.
|
|
||||||
test('waits for the listener still working when another one rejected', async t => {
|
test('waits for the listener still working when another one rejected', async t => {
|
||||||
const smpp = await startServer(t, { shutdownTimeout: 30_000 });
|
const smpp = await startServer(t, { shutdownTimeout: 30_000 });
|
||||||
const failed = once<Error>(resolve => {
|
const failed = once<Error>(resolve => {
|
||||||
|
|||||||
Reference in New Issue
Block a user