diff options
| author | Jenkins <jenkins@review.openstack.org> | 2015-07-11 01:06:07 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2015-07-11 01:06:07 +0000 |
| commit | fc64f6b565c2229da6b596ff6cffc614d815f5f5 (patch) | |
| tree | 3423f662f17159e14917e80ecc13db63107bb85a /taskflow/examples | |
| parent | 5fb62f3864e4a35d6b5e9401e9aa2b94b28d7c58 (diff) | |
| parent | c5c2d8482731747ac300ff58cf18849e742331dc (diff) | |
| download | taskflow-fc64f6b565c2229da6b596ff6cffc614d815f5f5.tar.gz | |
Merge "Show job posted and goodbye in 99_bottles.py example"
Diffstat (limited to 'taskflow/examples')
| -rw-r--r-- | taskflow/examples/99_bottles.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/taskflow/examples/99_bottles.py b/taskflow/examples/99_bottles.py index cbcf54c..e134b30 100644 --- a/taskflow/examples/99_bottles.py +++ b/taskflow/examples/99_bottles.py @@ -83,6 +83,10 @@ class Conclusion(task.Task): def make_bottles(count): + # This is the function that will be called to generate the workflow + # and will also be called to regenerate it on resumption so that work + # can continue from where it last left off... + s = lf.Flow("bottle-song") take_bottle = TakeABottleDown("take-bottle-%s" % count, @@ -103,6 +107,9 @@ def make_bottles(count): def run_conductor(): + # This continuously consumers until its stopped via ctrl-c or other + # kill signal... + event_watches = {} # This will be triggered by the conductor doing various activities @@ -149,6 +156,7 @@ def run_conductor(): def run_poster(): + # This just posts a single job and then ends... print("Starting poster with pid: %s" % ME) my_name = "poster-%s" % ME persist_backend = persistence_backends.fetch(PERSISTENCE_URI) @@ -173,7 +181,9 @@ def run_poster(): [HOW_MANY_BOTTLES], {}, backend=persist_backend) # Post, and be done with it! - job_backend.post("song-from-%s" % my_name, book=lb) + jb = job_backend.post("song-from-%s" % my_name, book=lb) + print("Posted: %s" % jb) + print("Goodbye...") def main(): |
