Add ZooKeeper backend to examples

Change-Id: I8c9408465392307ede2ff61e0524700e4c51ccad
This commit is contained in:
Changbin Liu
2014-02-05 16:34:59 -05:00
parent 24ab8d73ce
commit e9dfb10c2c
2 changed files with 19 additions and 0 deletions

View File

@@ -61,6 +61,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

@@ -44,6 +44,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 #########################################