Skip to content
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

Allow aborting all API requests by passing an abortSignal #630

Merged
merged 1 commit into from
Sep 7, 2021

Conversation

pimterry
Copy link
Contributor

@pimterry pimterry commented Aug 2, 2021

This adds support for an abortSignal option in every API method. This fixes #629.

This depends on the docker-modem change in apocas/docker-modem#132. You'll need to link that dependency in to test this successfully.

I've added a test just for the container.wait() method, since that's the most obviously interesting use case, but I think being able to abort all types of requests can be useful in various different contexts.

This must be a signal from a AbortController - either the built-in
controller available in Node 16+, or a compatible polyfill.
@pimterry pimterry mentioned this pull request Aug 30, 2021
@apocas apocas merged commit 9a50c26 into apocas:master Sep 7, 2021
@apocas
Copy link
Owner

apocas commented Sep 7, 2021

Published

@pimterry
Copy link
Contributor Author

pimterry commented Sep 7, 2021

Amazing, thanks so much @apocas!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow aborting requests
2 participants