MCPcopy
hub / github.com/fluentpython/example-code-2e / main

Function main

19-concurrency/spinner_async.py:28–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26
27# tag::SPINNER_ASYNC_START[]
28def main() -> None: # <1>
29 result = asyncio.run(supervisor()) # <2>
30 print(f'Answer: {result}')
31
32async def supervisor() -> int: # <3>
33 spinner = asyncio.create_task(spin('thinking!')) # <4>

Callers 1

spinner_async.pyFile · 0.70

Calls 2

supervisorFunction · 0.70
runMethod · 0.45

Tested by

no test coverage detected