Imagine having a long running task with a specific set of args and kwargs. Is there any chance to revoke all running and pending tasks with the same args/kwargs before starting a new task as Im only interested in the result of the last added task. (The underlying data changes inbetween two calls)
I tried iterating the results of inspect.active()
, inspect.registered()
and inspect.scheduled()
to get ALL tasks and then filter/revoke
those with my args and kwargs in question.
But this was not reliable as the inspecting of all workers and searching for tasks took way too long.
Anyone can get me in the right direction?