celery.bootsteps

A directed acyclic graph of reusable components.

class celery.bootsteps.Blueprint(steps=None, name=None, on_start=None, on_close=None, on_stopped=None)[исходный код]

Blueprint containing bootsteps that can be applied to objects.

Параметры:
  • Sequence[Union[str (steps) – List of steps.

  • Step]] – List of steps.

  • name (str) – Set explicit name for this blueprint.

  • on_start (Callable) – Optional callback applied after blueprint start.

  • on_close (Callable) – Optional callback applied before blueprint close.

  • on_stopped (Callable) – Optional callback applied after blueprint stopped.

GraphFormatter

alias of StepFormatter

property alias
apply(parent, **kwargs)[исходный код]

Apply the steps in this blueprint to an object.

This will apply the __init__ and include methods of each step, with the object as argument:

step = Step(obj)
...
step.include(obj)

For StartStopStep the services created will also be added to the objects steps attribute.

claim_steps()[исходный код]
close(parent)[исходный код]
connect_with(other)[исходный код]
default_steps = {}
human_state()[исходный код]
info(parent)[исходный код]
join(timeout=None)[исходный код]
load_step(step)[исходный код]
name = None
restart(parent, method='stop', description='restarting', propagate=False)[исходный код]
send_all(parent, method, description=None, reverse=True, propagate=True, args=())[исходный код]
start(parent)[исходный код]
started = 0
state = None
state_to_name = {0: 'initializing', 1: 'running', 2: 'closing', 3: 'terminating'}
stop(parent, close=True, terminate=False)[исходный код]
class celery.bootsteps.ConsumerStep(parent, **kwargs)[исходный код]

Bootstep that starts a message consumer.

consumers = None
get_consumers(channel)[исходный код]
name = 'celery.bootsteps.ConsumerStep'
requires = ('celery.worker.consumer:Connection',)
shutdown(c)[исходный код]
start(c)[исходный код]
stop(c)[исходный код]
class celery.bootsteps.StartStopStep(parent, **kwargs)[исходный код]

Bootstep that must be started and stopped in order.

close(parent)[исходный код]
include(parent)[исходный код]
name = 'celery.bootsteps.StartStopStep'
obj = None
start(parent)[исходный код]
stop(parent)[исходный код]
terminate(parent)[исходный код]
class celery.bootsteps.Step(parent, **kwargs)[исходный код]

A Bootstep.

The __init__() method is called when the step is bound to a parent object, and can as such be used to initialize attributes in the parent object at parent instantiation-time.

property alias
conditional = False
create(parent)[исходный код]

Create the step.

enabled = True
include(parent)[исходный код]
include_if(parent)[исходный код]

Return true if bootstep should be included.

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

info(obj)[исходный код]
instantiate(name, *args, **kwargs)[исходный код]
label = None
last = False
name = 'celery.bootsteps.Step'
requires = ()
Вернуться на верх