Merge "Add ZooKeeper backend to examples"

This commit is contained in:
Jenkins
2014-02-21 04:05:08 +00:00
committed by Gerrit Code Review
2 changed files with 19 additions and 0 deletions

View File

@@ -59,6 +59,12 @@ def _make_conf(backend_uri):
'path': parsed_url.path,
'connection': backend_uri,
}
elif backend_type in ('zookeeper',):
conf = {
'path': parsed_url.path,
'hosts': parsed_url.netloc,
'connection': backend_uri,
}
else:
conf = {
'connection': backend_uri,

View File

@@ -42,6 +42,19 @@ import example_utils # noqa
# to start an engine, have a task stop the engine from doing future work (if
# a multi-threaded engine is being used, then the currently active work is not
# preempted) and then resume the work later.
#
# Usage:
#
# With a filesytem directory as backend
#
# python taskflow/examples/resume_from_backend.py
#
# With ZooKeeper as backend
#
# python taskflow/examples/resume_from_backend.py \
# zookeeper://127.0.0.1:2181/taskflow/resume_from_backend/
#
### UTILITY FUNCTIONS #########################################