The
asyncio.run() is a Python function used to run a coroutine in an event loop. This function creates an event loop, runs the coroutine in the event loop, and finally closes the event loop when the coroutine is complete.
Note:
asyncio.run() should only be used once in a program and is intended as a convenient function to run asynchronous functions in a simple, single-threaded manner. For more advanced usage and control over the event loop, use
asyncio.run_until_complete() and
asyncio.get_event_loop() instead.