Non-blocking connection with Cayenne


First I want to apologize to the community for asking this question, if it has already been done and resolved, but I have not been able to find it. I also want to apologize for my bad English.
I have a project that works perfectly in local mode and I want to send the signals from the sensors to Cayenne through a wifi connection (I use Arduino Mega + ESP8266 and the library “CayenneMQTTESP8266Shield.h”). With the tests I have done the program is blocked because the Wi-Fi connection is bad or because the connection with the server is lost (it is blocked in the instruction "Cayenne.begin (username, password, clientID, wifi, ssid, wifiPassword) ; and every time I use Cayenne.virtualWrite … and the connection is interrupted ").
For me the most important thing is that the main program is not blocked and, if there is wifi connection, it should use it to send the data. How can I have to use the connection with Cayenne to avoid the program is blocked ?. Can you give me some example or link where this problem is solved?
Thank you


This issue has been brought up earlier and a solution for this issue is been requested several times. So we have kept this feature on cayenne roadmap and will be implemented soon.