WorkerConfig

class safir.arq.uws.WorkerConfig(arq_mode, arq_queue_url, arq_queue_password, grace_period, parameters_class, timeout)

Bases: Generic

Minimal configuration needed for building a UWS backend worker.

Parameters:

Attributes Summary

arq_mode

What mode to use for the arq queue.

arq_queue_password

Password of the Redis arq queue.

arq_queue_url

URL of the Redis arq queue.

arq_redis_settings

Redis settings for arq.

grace_period

How long to wait for workers to shut down before cancelling them.

parameters_class

Class of the parameters to pass to the backend worker.

timeout

Maximum execution time.

Attributes Documentation

arq_mode: ArqMode = <dataclasses._MISSING_TYPE object>

What mode to use for the arq queue.

arq_queue_password: str | None = <dataclasses._MISSING_TYPE object>

Password of the Redis arq queue.

arq_queue_url: str = <dataclasses._MISSING_TYPE object>

URL of the Redis arq queue.

arq_redis_settings

Redis settings for arq.

grace_period: timedelta = <dataclasses._MISSING_TYPE object>

How long to wait for workers to shut down before cancelling them.

This should be set to somewhat less than the Kubernetes grace period for terminating the pod (about five seconds less, for example).

parameters_class: type[TypeVar(T, bound= BaseModel)] = <dataclasses._MISSING_TYPE object>

Class of the parameters to pass to the backend worker.

timeout: timedelta = <dataclasses._MISSING_TYPE object>

Maximum execution time.

Jobs that run longer than this length of time will be automatically aborted.