Task #8496
closedTask #8495: [EPIC] As a user, I have a new-improved tasking system with new-style workers
Deprecate `enqueue_with_reservation` from plugin API and introduce new `dispatch` interface to replace it
100%
Description
Problem 1¶
The pulpcore.plugin.tasking.enqueue_with_reservation
interface, unfortunately, is tied to RQ because the return object is an RQ job. This prevents us from switching the implemenation away from RQ.
Problem 2¶
The options
keyword is RQ specific also, so we can't keep that as part of the new dispatch
function signature.
Solution¶
- Deprecate the
pulpcore.plugin.tasking.enqueue_with_reservation
- Introduce a new interface
pulpcore.plugin.tasking.dispatch
which will have the following function signature:
def dispatch(func, resources, args=None, kwargs=None, task_group=None):
The dispatch method will return the Task object.
Related issues
Updated by bmbouter over 3 years ago
- Description updated (diff)
- Status changed from NEW to ASSIGNED
- Assignee set to bmbouter
Updated by bmbouter over 3 years ago
- Blocks Task #8497: Remove the deprecated `enqueue_with_reservation` from the plugin API added
Updated by pulpbot over 3 years ago
- Status changed from ASSIGNED to POST
Updated by bmbouter over 3 years ago
- Sprint/Milestone set to 3.12.0
Adding to 3.12, this is ready for merging with one more review and it needs to go into 3.12 to prepare for the tasking work to come later.
Updated by bmbouter over 3 years ago
- Blocks Story #8501: As a user, I have new pulp workers that do not require a resource manager added
Added by bmbouter over 3 years ago
Updated by bmbouter over 3 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset pulpcore|753e4ddb184efa290d71b4a53b419d66a0b60745.
Updated by pulpbot over 3 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Adds new
dispatch
call and deprecate the old oneThis adds a new
pulpcore.plugin.tasking.dispatch
interface which will replace thepulpcore.plugin.tasking.enqueue_with_reservation
interface. This also deprecates thepulpcore.plugin.tasking.enqueue_with_reservation
and causes it to emit warnings if used.Additionally the
pulpcore.plugin.viewsets.OperationPostponedResponse
has been ported to support both thedispatch
andenqueue_with_reservation
interfaces.closes #8496