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

# `celery.worker.components`

Worker-level Bootsteps.

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

  Step used to embed a beat process.

  Enabled when the `beat` argument is set.

  conditional = True
  create(w)

    Create the step.

  label = 'Beat'
  name = 'celery.worker.components.Beat'

class celery.worker.components.Consumer(parent, **kwargs)

  Bootstep starting the Consumer blueprint.

  create(w)

    Create the step.

  last = True
  name = 'celery.worker.components.Consumer'

class celery.worker.components.Hub(w, **kwargs)

  Worker starts the event loop.

  create(w)

    Create the step.

  include_if(w)

    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)
  stop(w)
  terminate(w)

class celery.worker.components.Pool(w, autoscale=None, **kwargs)

  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)
  create(w)

    Create the step.

  info(w)
  name = 'celery.worker.components.Pool'
  register_with_event_loop(w, hub)
  requires = (step:celery.worker.components.Hub{(step:celery.worker.components.Timer{()},)},)
  terminate(w)

class celery.worker.components.StateDB(w, **kwargs)

  Bootstep that sets up between-restart state database file.

  create(w)

    Create the step.

  name = 'celery.worker.components.StateDB'

class celery.worker.components.Timer(parent, **kwargs)

  Timer bootstep.

  create(w)

    Create the step.

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