Increase timeout

This commit is contained in:
simon987 2022-01-29 10:38:23 -05:00
parent cd5a1ac50c
commit d578be3218
2 changed files with 4 additions and 3 deletions

View File

@ -34,7 +34,7 @@ class StatelessStreamWorker:
class StatelessStreamProcessor: class StatelessStreamProcessor:
def __init__(self, worker_factory, chunk_size=128, processes=1): def __init__(self, worker_factory, chunk_size=128, processes=1, timeout=60):
self._chunk_size = 128 self._chunk_size = 128
self._queue = MPQueue(maxsize=chunk_size) self._queue = MPQueue(maxsize=chunk_size)
self._queue_out = MPQueue(maxsize=processes * 2) self._queue_out = MPQueue(maxsize=processes * 2)
@ -42,6 +42,7 @@ class StatelessStreamProcessor:
self._processes = [] self._processes = []
self._factory = worker_factory self._factory = worker_factory
self._workers = [] self._workers = []
self._timeout = timeout
if processes > 1: if processes > 1:
for _ in range(processes): for _ in range(processes):
@ -67,7 +68,7 @@ class StatelessStreamProcessor:
ingest_thread = Thread(target=self._ingest, args=(iterable,)) ingest_thread = Thread(target=self._ingest, args=(iterable,))
ingest_thread.start() ingest_thread.start()
for results in queue_iter(self._queue_out, joinable=False, timeout=10): for results in queue_iter(self._queue_out, joinable=False, timeout=self._timeout):
yield from results yield from results
ingest_thread.join() ingest_thread.join()

View File

@ -2,7 +2,7 @@ from setuptools import setup
setup( setup(
name="hexlib", name="hexlib",
version="1.73", version="1.74",
description="Misc utility methods", description="Misc utility methods",
author="simon987", author="simon987",
author_email="me@simon987.net", author_email="me@simon987.net",