- # Create the asyncio event loop
- loop = asyncio.get_event_loop()
-
- # Queue up our `run()` coroutine for execution
- loop.create_task(run())
-
- # Start the event loop
- loop.run_forever()
+ # Run the deploy coroutine in an asyncio event loop, using a helper
+ # that abstracts loop creation and teardown.
+ loop.run(deploy())