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

Add abortPromise as a helper alongside abortSignal #512

Merged
merged 8 commits into from
Nov 22, 2024
Merged

Conversation

benjie
Copy link
Member

@benjie benjie commented Nov 22, 2024

Description

Still experimental; this allows you to await Promise.race([helpers.abortPromise, doTheThing()]) in your jobs, and have the timeout/abort fire conveniently.

Extracted from #474

Performance impact

Negligible - we construct it up top and it's shared by all tasks (not created on a per-task basis).

Security impact

None that I can think of 🤔

Checklist

  • My code matches the project's code style and yarn lint:fix passes.
  • I've added tests for the new feature, and yarn test passes.
  • I have detailed the new feature in the relevant documentation.
  • I have added this feature to 'Pending' in the RELEASE_NOTES.md file (if one exists).
  • If this is a breaking change I've explained why.

@benjie benjie merged commit 7b31a89 into main Nov 22, 2024
14 checks passed
@benjie benjie deleted the abort-promise branch November 22, 2024 15:28
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.

1 participant