MCPcopy
hub / github.com/celery/celery / prepare_workflow

Function prepare_workflow

examples/stamping/revoke_example.py:32–43  ·  view source on GitHub ↗

Creates a canvas that waits "n * sum(1..n) * 10" in seconds, with n = 3. The canvas itself is stamped with a unique monitoring id stamp per task. The waiting task is stamped with different consistent stamp, which is used to revoke the task by its stamped header.

()

Source from the content-addressed store, hash-verified

30
31
32def prepare_workflow() -> Signature:
33 """Creates a canvas that waits "n * sum(1..n) * 10" in seconds,
34 with n = 3.
35
36 The canvas itself is stamped with a unique monitoring id stamp per task.
37 The waiting task is stamped with different consistent stamp, which is used
38 to revoke the task by its stamped header.
39 """
40 canvas = create_canvas(n=3)
41 canvas = canvas | wait_for_revoke.s()
42 canvas.stamp(MonitoringIdStampingVisitor())
43 return canvas
44
45
46def run_then_revoke():

Callers 2

run_then_revokeFunction · 0.85
revoke_then_runFunction · 0.85

Calls 4

create_canvasFunction · 0.85
sMethod · 0.45
stampMethod · 0.45

Tested by

no test coverage detected