In this example you are saving the job after adding it to the queue (returns back a Job object) and then calling .abort().
How could someone grab items in a queue and cancel/abort them.
I guess my question is how to grab the Job object. I see there is arq.jobs.Job and there is a redis param but not sure if theres an easier way to set this.
class Job:
"""
Holds data a reference to a job.
"""
__slots__ = 'job_id', '_redis', '_queue_name', '_deserializer'
def __init__(
self,
job_id: str,
redis: 'Redis[bytes]',
....
Also I'm trying to get use to this typed Python world - what would 'Redis[bytes]', even look like?
Appreciate any help in advance.
Use Case
If a user wants to cancel a long task and re-trigger another. Or maybe I want to cancel a old task because the user triggerd an update.
So I see how you can cancel/abort a job like this: https://arq-docs.helpmanual.io/#retrying-jobs-and-cancellation
In this example you are saving the job after adding it to the queue (returns back a
Job
object) and then calling.abort()
.How could someone grab items in a queue and cancel/abort them. I guess my question is how to grab the
Job
object. I see there isarq.jobs.Job
and there is aredis
param but not sure if theres an easier way to set this.Also I'm trying to get use to this typed Python world - what would
'Redis[bytes]',
even look like?Appreciate any help in advance.
Use Case
If a user wants to cancel a long task and re-trigger another. Or maybe I want to cancel a old task because the user triggerd an update.