Merge "Add ZooKeeper backend to examples"
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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 #########################################
|
||||
|
||||
|
||||
Reference in New Issue
Block a user