celery.bootsteps
class celery.bootsteps.Blueprint(steps=None, name=None, app=None, on_start=None, on_close=None, on_stopped=None)
Blueprint containing bootsteps that can be applied to objects.
GraphFormatter
StepFormatter 的别名
alias None[源代码]
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:
For StartStopStep the services created will also be added to the objects steps attribute.
claim_steps()
close(parent)[源代码]
connect_with(other)
default_steps = set([])
human_state()[源代码]
info(parent)
load_step(step)[源代码]
name = None
restart(parent, method=u’stop’, description=u’restarting’, propagate=False)
send_all(parent, method, description=None, reverse=True, propagate=True, args=())[源代码]
start(parent)
state = None
state_to_name = {0: u’initializing’, 1: u’running’, 2: u’closing’, 3: u’terminating’}
stop(parent, close=True, terminate=False)[源代码]
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.
alias None[源代码]
conditional = False
Set this to true if the step is enabled based on some condition.
create(parent)
Create the step.
enabled = True
This provides the default for include_if().
include(parent)
include_if(parent)[源代码]
An optional predicate that decides whether this step should be created.
info(obj)
instantiate(name, \args, **kwargs*)[源代码]
last = False
name = u’celery.bootsteps.Step’
Optional step name, will use qualname if not specified.
requires = ()
List of other steps that that must be started before this step. Note that all dependencies must be in the same blueprint.
class celery.bootsteps.StartStopStep(parent, \*kwargs*)
close(parent)[源代码]
include(parent)
name = u’celery.bootsteps.StartStopStep’
obj = None
Optional obj created by the create() method. This is used by StartStopStep to keep the original service object.
requires = ()
start(parent)
stop(parent)[源代码]
terminate(parent)
class celery.bootsteps.ConsumerStep(parent, \*kwargs*)[源代码]
consumers = None
get_consumers(channel)
name = u’celery.bootsteps.ConsumerStep’
requires = (u’Connection’,)
shutdown(c)[源代码]
start(c)