Commit 9a86b3ea authored by Tim Schoof's avatar Tim Schoof
Browse files

Only reduce polling rate for likely done streamer

There are at most two active streamer which are not considered "likey done" at a time. Not reducing their polling rate decreases processing delays.
Also increase the default delay on error as this now only applies to
exceptional cases.
parent 107e0ed6
......@@ -19,7 +19,7 @@ def has_newer_substream(substream, substream_list):
class Streamer:
def __init__(
self, receiver, worker, delay_on_error=1,
self, receiver, worker, delay_on_error=3,
end_of_stream_callback=None):
self.receiver = receiver
self.worker = worker
......@@ -122,7 +122,7 @@ class Streamer:
try:
while not self.stopped.is_set():
success = self._process_stream()
if not success:
if self.likely_done and not success:
self.stopped.wait(self.delay_on_error)
self._increase_delay_on_error()
else:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment