Skip to content

Commit

Permalink
docs: add documentation on how to retrieve running jobs (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKs committed Mar 29, 2024
1 parent ab2dda2 commit ec1532b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/examples/job_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from arq import create_pool
from arq.connections import RedisSettings
from arq.jobs import Job


async def the_task(ctx):
print('running the task with id', ctx['job_id'])
Expand Down Expand Up @@ -37,6 +39,14 @@ async def main():
> None
"""

# you can retrieve jobs by using arq.jobs.Job
await redis.enqueue_job('the_task', _job_id='my_job')
job5 = Job(job_id='my_job', redis=redis)
print(job5)
"""
<arq job my_job>
"""

class WorkerSettings:
functions = [the_task]

Expand Down

0 comments on commit ec1532b

Please sign in to comment.