| 20 | super().__init__(socket_file, working_dir, local_dir, None, None, player_key, player_mem_limit, player_cpu) |
| 21 | |
| 22 | def stream_logs(self, stdout=True, stderr=True, line_action=lambda line: print(line.decode())): |
| 23 | assert not self.streaming |
| 24 | self.streaming = True |
| 25 | if stdout: |
| 26 | threading.Thread(target=self._stream_logs, args=(self.process.stdout, line_action), daemon=True).start() |
| 27 | if stderr: |
| 28 | threading.Thread(target=self._stream_logs, args=(self.process.stderr, line_action), daemon=True).start() |
| 29 | |
| 30 | def _stream_logs(self, stream, line_action): |
| 31 | for line in stream: |