Refactor pipe logic to a separate class
This commit is contained in:
@ -2,6 +2,7 @@ from threading import Thread
|
||||
from queue import Queue
|
||||
|
||||
from .terminate_process_on_failure import terminate_process_on_failure
|
||||
from .pipe import Pipe
|
||||
|
||||
|
||||
class PipeWriterThread(Thread):
|
||||
@ -19,8 +20,7 @@ class PipeWriterThread(Thread):
|
||||
message = self._write_queue.get(block=True)
|
||||
if message is None:
|
||||
break
|
||||
with open(self._pipe_path, 'wb') as pipe:
|
||||
pipe.write(message)
|
||||
Pipe(self._pipe_path).write(message)
|
||||
|
||||
def stop(self):
|
||||
self._write_queue.put(None)
|
||||
|
Reference in New Issue
Block a user