Skip to content

Commit

Permalink
Update async.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelCurrin authored Aug 6, 2024
1 parent 74e0522 commit 3d06b63
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cheatsheets/python/builtins/async.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import asyncio

async def my_coroutine():
await asyncio.sleep(1)

return "Done"
```

Expand All @@ -30,7 +31,7 @@ loop = asyncio.get_event_loop()
loop.run_until_complete(my_coroutine())
```

## Key Functions
## Key functions

### asyncio.run()

Expand Down Expand Up @@ -73,6 +74,7 @@ Runs multiple coroutines concurrently.
```python
async def fetch(url):
await asyncio.sleep(1)

return f"Result from {url}"

async def main():
Expand Down

0 comments on commit 3d06b63

Please sign in to comment.