Actions
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
Start date:
Due date:
% Done:
100%
Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:
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
Actions
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