((subscription = mqtt.readSubscription(5000)))

I'm using "mqtt.readSubscription(5000)" in my script and work fine to receive onoff button information.
But the problem is that my main loop is waiting 5sec and do nothing.
So reading a local switch or data from I2C is stopped this time. I must push more then 5 sec before he read the status. If I set the time from 5000 to 50 he don't receive messages from adafruit server.
Is there a solution ?

Is there a solution ?

Possibly.

When you post a link to the non-standard library (or links to the non-standard libraries) you are using AND your code, we can talk about the possibilities.