Skip to main content

StateDB

Bootstep that sets up between-restart state database file.

Attributes

AttributeTypeDescription
enabledboolFlag indicating whether the state database persistence is active, determined by the worker's statedb configuration.

Constructor

Signature

def StateDB(
w: [Worker](../../events/state/worker.md?sid=celery_events_state_worker),
**kwargs: dict
) - > null

Parameters

NameTypeDescription
w[Worker](../../events/state/worker.md?sid=celery_events_state_worker)The worker instance associated with this bootstep.
**kwargsdictAdditional keyword arguments passed to the parent class constructor.

Signature

def StateDB(
w: celery.worker.Worker,
**kwargs: dict
) - > null

Parameters

NameTypeDescription
wcelery.worker.WorkerThe worker instance this bootstep is being attached to.
**kwargsdictAdditional configuration arguments passed to the parent Step class.

Methods


create()

@classmethod
def create(
w: celery.worker.Worker
) - > null

Instantiates the persistent state storage for the worker and registers an exit handler to ensure state is saved to disk upon shutdown.

Parameters

NameTypeDescription
wcelery.worker.WorkerThe worker instance for which the persistent state database is being created.

Returns

TypeDescription
nullNone