New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for aborting a request using AbortSignal #205
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@Fdawgs it seems CI is not running, could u take a look? |
Let me push a no-op amend and see if it triggers. Maybe GitHub glitched. |
There we go, thanks @segevfiner! |
Derp. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe throw if those things are not available?
You can use { skip: !global.AbortController }
to skipt the test.
Co-authored-by: Matteo Collina <matteo.collina@gmail.com>
You'll need to ignore those lines from the code coverage. |
this now conflicts with master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This adds support for passing an
AbortSignal
. Adding support forClientRequest.destroy
&ClientRequest.setTimeout
will require figuring out an appropriate change to theinject
interface as it currently doesn't return such a pending request object but only has a callback or promise. Also note that such cancellation and timeouts should effect technically also effect thesocket
causing it to emit appropriate events and/or change state. But we aren't emulating much of the socket ATM.Relates to #203
Checklist
npm run test
andnpm run benchmark
and the Code of conduct