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

Function main_async

example_code/item_076.py:484–492  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

482
483print("Example 29")
484async def main_async():
485 address = ("127.0.0.1", 4321)
486
487 server = run_async_server(address)
488 asyncio.create_task(server)
489
490 results = await run_async_client(address)
491 for number, outcome in results:
492 print(f"Client: {number} is {outcome}")
493
494logging.getLogger().setLevel(logging.ERROR)
495

Callers 1

item_076.pyFile · 0.85

Calls 2

run_async_serverFunction · 0.85
run_async_clientFunction · 0.85

Tested by

no test coverage detected