mirror of
https://github.com/autistic-symposium/web3-starter-py.git
synced 2025-06-09 07:32:57 -04:00
add concurrence examples
This commit is contained in:
parent
614452d462
commit
516c922e02
15 changed files with 64 additions and 248 deletions
Concurrence_examples
|
@ -2,14 +2,13 @@
|
|||
|
||||
import asyncio
|
||||
|
||||
|
||||
async def delayed_hello():
|
||||
print("Hello ")
|
||||
print('Hello ')
|
||||
await asyncio.sleep(1)
|
||||
print("World!")
|
||||
print('World!')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.run_until_complete(delayed_hello())
|
||||
loop.close()
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.run_until_complete(delayed_hello())
|
||||
loop.close()
|
Loading…
Add table
Add a link
Reference in a new issue