Implement support for waiting for PipeIOServer to stop

This commit is contained in:
Kristóf Tóth 2019-05-09 13:26:48 +02:00
parent b1d23f9d95
commit 8f80f49a86
2 changed files with 4 additions and 0 deletions

View File

@ -16,3 +16,4 @@ if __name__ == "__main__":
print('Running pipe IO server with named pipes:') print('Running pipe IO server with named pipes:')
print(f'Input: {pipe_io.in_pipe}') print(f'Input: {pipe_io.in_pipe}')
print(f'Output: {pipe_io.out_pipe}') print(f'Output: {pipe_io.out_pipe}')
pipe_io.wait()

View File

@ -58,3 +58,6 @@ class PipeIOServer(ABC, Thread):
thread.stop() thread.stop()
Pipe(self.in_pipe).remove() Pipe(self.in_pipe).remove()
Pipe(self.out_pipe).remove() Pipe(self.out_pipe).remove()
def wait(self):
self._stop_event.wait()