MCPcopy Create free account
hub / github.com/celery/celery / StartStopStep

Class StartStopStep

celery/bootsteps.py:355–383  ·  view source on GitHub ↗

Bootstep that must be started and stopped in order.

Source from the content-addressed store, hash-verified

353
354
355class StartStopStep(Step):
356 """Bootstep that must be started and stopped in order."""
357
358 #: Optional obj created by the :meth:`create` method.
359 #: This is used by :class:`StartStopStep` to keep the
360 #: original service object.
361 obj = None
362
363 def start(self, parent):
364 if self.obj:
365 return self.obj.start()
366
367 def stop(self, parent):
368 if self.obj:
369 return self.obj.stop()
370
371 def close(self, parent):
372 pass
373
374 def terminate(self, parent):
375 if self.obj:
376 return getattr(self.obj, 'terminate', self.obj.stop)()
377
378 def include(self, parent):
379 inc, ret = self._should_include(parent)
380 if inc:
381 self.obj = ret
382 parent.steps.append(self)
383 return inc
384
385
386class ConsumerStep(StartStopStep):

Callers 1

test_start__stopMethod · 0.90

Calls

no outgoing calls

Tested by 1

test_start__stopMethod · 0.72