Skip to content

Commit

Permalink
Update README example with asyncio.run
Browse files Browse the repository at this point in the history
[asyncio.run](https://docs.python.org/3/library/asyncio-runner.html#asyncio.run) is the current, documented method to begin and clean up an async event loop, as of python3.7.

python3.9 is the oldest version of python that isn't EOL.
  • Loading branch information
PaarthShah authored Feb 5, 2025
1 parent f1d47ed commit bb78715
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ async def main():


if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
asyncio.run(main())
```

More complicated examples, like asynchronous multiple watch or tail logs from pods,
Expand Down

0 comments on commit bb78715

Please sign in to comment.