Skip to content

worker

SAQ worker and queue.

queue module-attribute

queue = Queue(redis.client)

Queue instance instantiated with redis instance.

Queue

Queue(*args, **kwargs)

Bases: saq.Queue

SAQ Queue

Configures orjson for JSON serialization/deserialization if not otherwise configured.

Parameters

args : Any Passed through to saq.Queue.__init__() *kwargs : Any Passed through to saq.Queue.__init__()

Worker

Bases: saq.Worker

Modify behavior of saq worker for orchestration by Starlite.

on_app_startup async

on_app_startup()

Attach the worker to the running event loop.

create_worker_instance

create_worker_instance(functions)

Parameters:

Name Type Description Default
functions abc.Collection[WorkerFunction | tuple[str, WorkerFunction]]

Functions to be called via the async workers.

required

Returns:

Type Description
Worker

The worker instance, instantiated with functions.