MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / run_fully_async

Function run_fully_async

example_code/item_078.py:172–180  ·  view source on GitHub ↗
(handles, interval, output_path)

Source from the content-addressed store, hash-verified

170 await write_func(line)
171
172async def run_fully_async(handles, interval, output_path):
173 async with (
174 WriteThread(output_path) as output,
175 asyncio.TaskGroup() as group,
176 ):
177 for handle in handles:
178 group.create_task(
179 tail_async(handle, interval, output.write)
180 )
181
182
183print("Example 9")

Callers 1

item_078.pyFile · 0.85

Calls 2

WriteThreadClass · 0.85
tail_asyncFunction · 0.70

Tested by

no test coverage detected