Add new argument of type asyncio.Event to allow better control of the execution inside connect function.
Add new argument of type asyncio.Event to allow better control of the execution inside connect function.