This document describes the current stable version of Celery (5.2). For development docs, go here.

celery.worker.components

Worker-level Bootsteps.

class celery.worker.components.Beat(w, beat=False, **kwargs)[source]

Step used to embed a beat process.

Enabled when the beat argument is set.

conditional = True
create(w)[source]

Create the step.

label = 'Beat'
name = 'celery.worker.components.Beat'
class celery.worker.components.Consumer(parent, **kwargs)[source]

Bootstep starting the Consumer blueprint.

create(w)[source]

Create the step.

last = True
name = 'celery.worker.components.Consumer'
class celery.worker.components.Hub(w, **kwargs)[source]

Worker starts the event loop.

create(w)[source]

Create the step.

include_if(w)[source]

Return true if bootstep should be included.

You can define this as an optional predicate that decides whether this step should be created.

name = 'celery.worker.components.Hub'
requires = (step:celery.worker.components.Timer{()},)
start(w)[source]
stop(w)[source]
terminate(w)[source]
class celery.worker.components.Pool(w, autoscale=None, **kwargs)[source]

Bootstep managing the worker pool.

Describes how to initialize the worker pool, and starts and stops the pool during worker start-up/shutdown.

Adds attributes:

  • autoscale

  • pool

  • max_concurrency

  • min_concurrency

close(w)[source]
create(w)[source]

Create the step.

info(w)[source]
name = 'celery.worker.components.Pool'
register_with_event_loop(w, hub)[source]
requires = (step:celery.worker.components.Hub{(step:celery.worker.components.Timer{()},)},)
terminate(w)[source]
class celery.worker.components.StateDB(w, **kwargs)[source]

Bootstep that sets up between-restart state database file.

create(w)[source]

Create the step.

name = 'celery.worker.components.StateDB'
class celery.worker.components.Timer(parent, **kwargs)[source]

Timer bootstep.

create(w)[source]

Create the step.

name = 'celery.worker.components.Timer'
on_timer_error(exc)[source]
on_timer_tick(delay)[source]