summaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools/workers/worker_common.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-08 14:59:57 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-08 15:03:51 -0800
commitbb4a5e47bae054ad9abe500f1a81d30db4e65306 (patch)
tree9e6d37215f7099cca44f6ba5778980411df8a180 /python/fatcat_tools/workers/worker_common.py
parent8c930ded07b6a668bc1721ef98312d9259c06b59 (diff)
downloadfatcat-bb4a5e47bae054ad9abe500f1a81d30db4e65306.tar.gz
fatcat-bb4a5e47bae054ad9abe500f1a81d30db4e65306.zip
workers do API-passing (not URI-passing)
Diffstat (limited to 'python/fatcat_tools/workers/worker_common.py')
-rw-r--r--python/fatcat_tools/workers/worker_common.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/python/fatcat_tools/workers/worker_common.py b/python/fatcat_tools/workers/worker_common.py
index e400e815..b84341c7 100644
--- a/python/fatcat_tools/workers/worker_common.py
+++ b/python/fatcat_tools/workers/worker_common.py
@@ -45,11 +45,9 @@ class FatcatWorker:
Common code for for Kafka producers and consumers.
"""
- def __init__(self, kafka_hosts, produce_topic=None, consume_topic=None, api_host_url=None):
- if api_host_url:
- conf = fatcat_client.Configuration()
- conf.host = api_host_url
- self.api = fatcat_client.DefaultApi(fatcat_client.ApiClient(conf))
+ def __init__(self, kafka_hosts, produce_topic=None, consume_topic=None, api=None):
+ if api:
+ self.api = api
self.kafka = KafkaClient(hosts=kafka_hosts, broker_version="1.0.0")
self.produce_topic = produce_topic
self.consume_topic = consume_topic