(handles, interval, output_path)
| 51 | import asyncio |
| 52 | |
| 53 | async def run_tasks(handles, interval, output_path): |
| 54 | loop = asyncio.get_event_loop() |
| 55 | |
| 56 | output = await loop.run_in_executor(None, open, output_path, "wb") |
| 57 | try: |
| 58 | |
| 59 | async def write_async(data): |
| 60 | await loop.run_in_executor(None, output.write, data) |
| 61 | |
| 62 | async with asyncio.TaskGroup() as group: |
| 63 | for handle in handles: |
| 64 | group.create_task( |
| 65 | tail_async(handle, interval, write_async) |
| 66 | ) |
| 67 | finally: |
| 68 | await loop.run_in_executor(None, output.close) |
| 69 | |
| 70 | |
| 71 | print("Example 2") |
nothing calls this directly
no test coverage detected