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

Implementing task subscription filtering #11805

Merged
merged 2 commits into from
Feb 2, 2024
Merged

Conversation

chrisguidry
Copy link
Collaborator

The goal here is for each subscriber to be able to filter to a subset of the
tasks they are interested in (i.e. which tasks a task server is serving). This
required routing task runs into queues and monitoring multiple queues for
tasks. This was a good opportunity to refactor some of the mechanics here to
capture the idea that a TaskQueue is really two queues (a "regular" queue and
a high-priority retry queue). This led me down a path of tidying up the
implementation to remove globals and encapsulate more of the behavior.

@chrisguidry chrisguidry requested review from zangell44 and a team as code owners February 1, 2024 21:00
Base automatically changed from restore-scheduled-tasks-at-startup to main February 1, 2024 21:23
Copy link

netlify bot commented Feb 1, 2024

Deploy Preview for prefect-docs-preview ready!

Name Link
🔨 Latest commit 9c43e26
🔍 Latest deploy log https://app.netlify.com/sites/prefect-docs-preview/deploys/65bcfc9c1c695600081071bb
😎 Deploy Preview https://deploy-preview-11805--prefect-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

)

if not task_runs:
winner, *placers = finishers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

@@ -127,9 +122,7 @@ async def test_scheduled_tasks_are_enqueued_server_side(
task_run: TaskRun = await foo_task_with_result_storage.submit(42)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we shouldn't have to await this but that's because the _create_autonomous_task_run thing has the sync_compatible decorator on it which doesn't know both that this is an async context and that this task is sync - have a fix coming here

The goal here is for each subscriber to be able to filter to a subset of the
tasks they are interested in (i.e. which tasks a task server is serving).  This
required routing task runs into queues and monitoring multiple queues for
tasks.  This was a good opportunity to refactor some of the mechanics here to
capture the idea that a `TaskQueue` is really two queues (a "regular" queue and
a high-priority retry queue).  This led me down a path of tidying up the
implementation to remove globals and encapsulate more of the behavior.
@chrisguidry chrisguidry merged commit 90bebab into main Feb 2, 2024
59 of 60 checks passed
@chrisguidry chrisguidry deleted the task-subscription-filtering branch February 2, 2024 14:47
@serinamarie serinamarie added the enhancement An improvement of an existing feature label Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants