async def _async_main(example_coroutine, client, args):
<EOL>task = asyncio.ensure_future(client.connect())<EOL>on_connect = asyncio.Future()<EOL>client.on_connect.add_observer(lambda: on_connect.set_result(None))<EOL>done, _ = await asyncio.wait(<EOL>(on_connect, task), return_when=asyncio.FIRST_COMPLETED<EOL>)<EOL>await asyncio.gather(*done)<EOL>try:<EOL><INDENT>await example_coroutine(client, args)<EOL><DEDENT>except asyncio.CancelledError:<EOL><INDENT>pass<EOL><DEDENT>finally:<EOL><INDENT>await client.disconnect()<EOL>await task<EOL><DEDENT>
Run the example coroutine.