Terminate process if any of the IO threads fail
This commit is contained in:
		@@ -1,6 +1,8 @@
 | 
			
		||||
from threading import Thread
 | 
			
		||||
from queue import Queue
 | 
			
		||||
 | 
			
		||||
from .terminate_process_on_failure import terminate_process_on_failure
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class PipeWriterThread(Thread):
 | 
			
		||||
    def __init__(self, pipe_path):
 | 
			
		||||
@@ -11,6 +13,7 @@ class PipeWriterThread(Thread):
 | 
			
		||||
    def write(self, message):
 | 
			
		||||
        self._write_queue.put(message, block=True)
 | 
			
		||||
 | 
			
		||||
    @terminate_process_on_failure
 | 
			
		||||
    def run(self):
 | 
			
		||||
        while True:
 | 
			
		||||
            message = self._write_queue.get(block=True)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user