Show job posted and goodbye in 99_bottles.py example

This makes it more obvious exactly what this job poster
has done and why it exited (all it is supposed to do is
post some work and die).

Change-Id: I7e83f90e0af0edf8836d6950b45905982e32a57f
This commit is contained in:
Joshua Harlow
2015-07-08 17:33:36 -07:00
parent df5fbe469c
commit c5c2d84827

View File

@@ -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():