WorkerSettings#
- class safir.arq.WorkerSettings(functions, redis_settings, job_completion_wait, job_timeout, max_jobs, allow_abort_jobs=False, queue_name='arq:queue', on_startup=None, on_shutdown=None, cron_jobs=None)#
Bases:
objectConfiguration class for an arq worker.
The arq command-line tool reads a class of the name
WorkerSettingsin the module it was given on the command line and turns its attributes into parameters toarq.worker.Worker. This dataclass represents the subset of the available settings that Safir applications have needed to date, as an aid for constructing that configuration object.- Parameters:
Attributes Summary
Whether to allow jobs to be aborted.
Cron jobs to run.
Coroutines to register as arq worker entry points.
How long to wait for jobs to complete before cancelling them.
Maximum timeout for all jobs.
Maximum number of jobs that can be run at one time.
Coroutine to run on shutdown.
Coroutine to run on startup.
Name of arq queue to listen to for jobs.
Redis configuration for arq.
Attributes Documentation
-
functions:
Sequence[Union[Function,WorkerCoroutine]] = MISSING# Coroutines to register as arq worker entry points.
-
job_completion_wait:
Union[int,float,timedelta] = MISSING# How long to wait for jobs to complete before cancelling them.
-
redis_settings:
RedisSettings= MISSING# Redis configuration for arq.