(stream, prefix)
| 32 | self._is_starting = False |
| 33 | |
| 34 | async def stream_output(stream, prefix): |
| 35 | while True: |
| 36 | line = await stream.readline() |
| 37 | if line: |
| 38 | message = f"{prefix}{line.decode().strip()}" |
| 39 | print(message,flush=True) #flush output immediately |
| 40 | if prefix == "STDOUT: ": # only add stdout |
| 41 | await self._output_queue.put(message) |
| 42 | |
| 43 | else: |
| 44 | break |
| 45 | |
| 46 | # Create tasks and store them to cancel later |
| 47 | stdout_task = asyncio.create_task(stream_output(self._process.stdout, "STDOUT: ")) |
nothing calls this directly
no outgoing calls
no test coverage detected