Add ZooKeeper backend to examples
Change-Id: I8c9408465392307ede2ff61e0524700e4c51ccad
This commit is contained in:
@@ -61,6 +61,12 @@ def _make_conf(backend_uri):
|
|||||||
'path': parsed_url.path,
|
'path': parsed_url.path,
|
||||||
'connection': backend_uri,
|
'connection': backend_uri,
|
||||||
}
|
}
|
||||||
|
elif backend_type in ('zookeeper',):
|
||||||
|
conf = {
|
||||||
|
'path': parsed_url.path,
|
||||||
|
'hosts': parsed_url.netloc,
|
||||||
|
'connection': backend_uri,
|
||||||
|
}
|
||||||
else:
|
else:
|
||||||
conf = {
|
conf = {
|
||||||
'connection': backend_uri,
|
'connection': backend_uri,
|
||||||
|
|||||||
@@ -44,6 +44,19 @@ import example_utils # noqa
|
|||||||
# to start an engine, have a task stop the engine from doing future work (if
|
# 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
|
# a multi-threaded engine is being used, then the currently active work is not
|
||||||
# preempted) and then resume the work later.
|
# 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 #########################################
|
### UTILITY FUNCTIONS #########################################
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user