Use await
expression before the coroutine.
await set_pizza_status_to_ready()
It is not a function but a coroutine, it yields. You need to await
it.
But there are some restrictions. You can not use the await
keyword if you are not calling a coroutine inside a coroutine function.
There are also some workarounds for this
You can use asyncio.run(my_coroutine)
to run a coroutine inside a function.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…