Closed pimterry closed 3 years ago
This will make it possible to abort Dockerode requests (https://github.com/apocas/dockerode/issues/629). In practice this looks like:
const abortController = new AbortController(); modem.dial({ // ... abortSignal: abortController.signal }); // Later, abort the ongoing request: abortController.abort(); // -> The request returns an AbortError (code: ABORT_ERROR)
I've tested this in Dockerode already, and there will be PR there coming shortly that uses this.
Using this in practice requires either Node 16, or Node 14+ with your own AbortController implementation that polyfills the standard (probably https://www.npmjs.com/package/node-abort-controller).
In other environments nothing breaks, you just can't abort requests, because the signal option is ignored by the HTTP module.
signal
👍 Will ping when published.
Published
This will make it possible to abort Dockerode requests (https://github.com/apocas/dockerode/issues/629). In practice this looks like:
I've tested this in Dockerode already, and there will be PR there coming shortly that uses this.
Using this in practice requires either Node 16, or Node 14+ with your own AbortController implementation that polyfills the standard (probably https://www.npmjs.com/package/node-abort-controller).
In other environments nothing breaks, you just can't abort requests, because the
signal
option is ignored by the HTTP module.