MCPcopy
hub / github.com/celery/celery / election

Method election

celery/canvas.py:787–797  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

785 return self.__or__(other)
786
787 def election(self):
788 type = self.type
789 app = type.app
790 tid = self.options.get('task_id') or uuid()
791
792 with app.producer_or_acquire(None) as producer:
793 props = type.backend.on_task_call(producer, tid)
794 app.control.election(tid, 'task',
795 self.clone(task_id=tid, **props),
796 connection=producer.connection)
797 return type.AsyncResult(tid)
798
799 def reprcall(self, *args, **kwargs):
800 """Return a string representation of the signature.

Callers 2

test_electionMethod · 0.45
test_electionMethod · 0.45

Calls 5

cloneMethod · 0.95
producer_or_acquireMethod · 0.80
getMethod · 0.45
on_task_callMethod · 0.45
AsyncResultMethod · 0.45

Tested by 2

test_electionMethod · 0.36
test_electionMethod · 0.36