-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: support independent task queue for workforce #3232
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
Conversation
…hile pending task assumes single) task
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-authored-by: a7m-1st <[email protected]>
Co-authored-by: Wendong-Fan <[email protected]>
Description
First part support for #3215 , which is an independent task queue.
New functions:
get_independent_tasks
- get _indepedent_task_queueadd_task
- now also adds to _indepedent_task_queue if flag is set, otherwise just treats as another sub_taskremove_task
- either removes from _indepedent_task_queue or _pending_task_queue given Task.id_handle_skip_task
- handles skipping tasks situationshandle_decompose_append_task
- abstract the task decompositon, validation and return into a separate function thus simplifyingprocess_task_async
&_process_task_with_snapshot
handle_independent_tasks
- decompose the task from queue and manage it (add to completed tasks if no error)Skipping (skip_gracefully & _async_skip_gracefully => triggers
_handle_skip_task
)2.1.1 Mark task as complete
2.1.2 Transfer tasks to confirmed queue
if task is in
channel
:2.2.1 Extract task from channel (thus
get_in_flight_tasks
(SENT, RETURNED or PROCESSING) from task_channel)2.2.2 Run 2.1.1 & 2.1.2 for each task
_independent_task_queue
is not empty3.1 Get the next task from
_independent_task_queue
then decompose it and continue loop.else:
stop the loop.
Discussion, Doubts and Future enhancements:
I didn't get the chance to test if it has been Archived for now but will review it.
publisher_id
is new with each Task instance. Bcz I am essentially wiping it and marking as completed.Todos
Checklist
Go over all the following points, and put an
x
in all the boxes that apply.Fixes #issue-number
in the PR description (required)pyproject.toml
anduv lock
If you are unsure about any of these, don't hesitate to ask. We are here to help!