From c560cc20100b038445287a185f00920cc156b08a Mon Sep 17 00:00:00 2001 From: simon987 Date: Sun, 19 Sep 2021 14:19:17 -0400 Subject: [PATCH] tweak StatefulStreamWorker interface --- hexlib/concurrency.py | 7 +++++-- setup.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hexlib/concurrency.py b/hexlib/concurrency.py index 864703a..37c01f8 100644 --- a/hexlib/concurrency.py +++ b/hexlib/concurrency.py @@ -13,15 +13,18 @@ class StatefulStreamWorker: def run(self, q: Queue): for chunk in queue_iter(q, joinable=False, timeout=3): - self.process_chunk(chunk) + self._process_chunk(chunk) - def process_chunk(self, chunk): + def _process_chunk(self, chunk): for item in chunk: self.process(item) def process(self, item) -> None: raise NotImplementedError + def results(self): + raise NotImplementedError + class StatefulStreamProcessor: def __init__(self, worker_factory, chunk_size=128, processes=1): diff --git a/setup.py b/setup.py index 40855f4..bc7bffc 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name="hexlib", - version="1.54", + version="1.55", description="Misc utility methods", author="simon987", author_email="me@simon987.net",