Consolidate YAML files [part-7] (#9262)

* Consolidate YAML files [part-7]

This PR relocates YAML files used by Job/CronJob examples.

* Update examples_test.go
This commit is contained in:
Qiming
2018-07-03 04:54:18 +08:00
committed by k8s-ci-robot
parent 3a0c618734
commit 48897cc47d
17 changed files with 39 additions and 27 deletions
@@ -0,0 +1,23 @@
#!/usr/bin/env python
import time
import rediswq
host="redis"
# Uncomment next two lines if you do not have Kube-DNS working.
# import os
# host = os.getenv("REDIS_SERVICE_HOST")
q = rediswq.RedisWQ(name="job2", host="redis")
print("Worker with sessionID: " + q.sessionID())
print("Initial queue state: empty=" + str(q.empty()))
while not q.empty():
item = q.lease(lease_secs=10, block=True, timeout=2)
if item is not None:
itemstr = item.decode("utf=8")
print("Working on " + itemstr)
time.sleep(10) # Put your actual work here instead of sleep.
q.complete(item)
else:
print("Waiting for work")
print("Queue empty, exiting")