celery.worker.components

celery.worker.components

Default worker bootsteps.

class celery.worker.components.Timer(parent, \*kwargs*)[源代码]

This step initializes the internal timer used by the worker.

class celery.worker.components.Hub(w, \*kwargs*)[源代码]

class celery.worker.components.Queues(parent, \*kwargs*)[源代码]

This bootstep initializes the internal queues used by the worker.

  • create(w)[源代码]

  • label = ‘Queues (intra)’

  • name = u’celery.worker.components.Queues’

  • requires = (step:celery.worker.components.Hub{(step:celery.worker.components.Timer{()},)},)

class celery.worker.components.Pool(w, autoscale=None, autoreload=None, no_execv=False, optimization=None, \*kwargs*)[源代码]

Bootstep managing the worker pool.

Describes how to initialize the worker pool, and starts and stops the pool during worker startup/shutdown.

Adds attributes:

  • autoscale
  • pool
  • max_concurrency
  • min_concurrency
  • close(w)[源代码]

  • create(w, semaphore=None, max_restarts=None)[源代码]

  • info(w)[源代码]

  • name = u’celery.worker.components.Pool’

  • register_with_event_loop(w, hub)[源代码]

  • requires = (step:celery.worker.components.Queues{(step:celery.worker.components.Hub{(step:celery.worker.components.Timer{()},)},)},)

  • terminate(w)[源代码]

class celery.worker.components.Beat(w, beat=False, \*kwargs*)[源代码]

Step used to embed a beat process.

This will only be enabled if the beat argument is set.

  • conditional = True

  • create(w)[源代码]

  • label = ‘Beat’

  • name = u’celery.worker.components.Beat’

  • requires = ()

class celery.worker.components.StateDB(w, \*kwargs*)[源代码]

This bootstep sets up the workers state db if enabled.

  • create(w)[源代码]

  • name = u’celery.worker.components.StateDB’

  • requires = ()

class celery.worker.components.Consumer(parent, \*kwargs*)[源代码]

  • create(w)[源代码]

  • last = True

  • name = u’celery.worker.components.Consumer’

  • requires = ()