summaryrefslogtreecommitdiff
path: root/t/eager_and_scheduled.py
blob: 030b539d8ed7f2e20294c9b06b53dfd639689ddf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import asyncio


async def foo():
    await asyncio.sleep(1.0)
    await baz()
    await asyncio.sleep(0.5)


async def bar():
    proc = await asyncio.create_subprocess_shell('sleep 1.0')
    await proc.communicate()


async def baz():
    await asyncio.sleep(1.0)


asyncio.run(foo())
asyncio.run(bar())