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 API to replace an existing async job #14602

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

y5nw
Copy link
Contributor

@y5nw y5nw commented Apr 30, 2024

This PR adds an API to replace existing async jobs. The new job is queued if the old job cannot be replaced (e.g. if the old job is already run).

  • Goal of the PR
    See above
  • How does the PR work?
    The async engine attempts to replace the existing queue if possible and falls back to queueing the new job.
    Job cancellation is trivially implemented based on this by replacing the old job with an empty function.
  • Does it resolve any reported issue?
    Partially addresses No proper way to deal with async job interdependencies / no cancellation #13681
  • Does this relate to a goal in the roadmap?
    See linked issue.
  • If not a bug fix, why is this PR needed? What usecases does it solve?
    See linked issue.

To do

This PR is a Work in Progress.

  • Implement replacing jobs
  • Implement job cancellation
  • Add tests for
    • Replacing jobs before the job is run
    • Replacing jobs after the job is complete
    • Canceling jobs
  • Add documentation

How to test

The new API should be covered by unittests.

Note that I have not yet figured out how to test certain things mentioned in the PR, such as canceling existing async jobs on shutdown.

@sfan5 sfan5 added Feature ✨ PRs that add or enhance a feature @ Script API labels May 2, 2024
@Zughy Zughy added the Concept approved Approved by a core dev: PRs welcomed! label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Concept approved Approved by a core dev: PRs welcomed! Feature ✨ PRs that add or enhance a feature @ Script API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants