build_worker#
- safir.arq.uws.build_worker(worker, config, logger)#
Construct an arq worker for the provided backend function.
Builds an arq worker configuration that wraps the provided sync function and executes it on messages to the default arq queue. Wobbly will be updated when the job starts executing and again when the job finishes.
- Parameters:
worker (
Callable
[[TypeVar
(T
, bound=BaseModel
),WorkerJobInfo
,BoundLogger
],list
[WorkerResult
]]) – Synchronous function that does the actual work. This function will be run in a thread pool of size one.config (
WorkerConfig
[TypeVar
(T
, bound=BaseModel
)]) – UWS worker configuration.logger (
BoundLogger
) – Logger to use for messages.
- Return type: