boolean waitForZero(long timeoutMs) throws InterruptedException {
            if (timeoutMs == -1) {
                return waitForZero();
            } else {
                long timeStart = SystemTimer.INSTANCE.milliTime();
                long timeLeft = timeoutMs;
                while (timeLeft > 0) {
                    synchronized(this) {
                        if (value > 0) {
                            wait(timeLeft);
                        } else {
                            return true;
                        }
                    }
                    long elapsed = SystemTimer.INSTANCE.milliTime() - timeStart;
                    timeLeft = timeoutMs - elapsed;
                }
                return false;
            }
        }
Implement replyHandler from messagebus. Called when a reply is received from messagebus.
Tries to find the callback from the reply context and updates the pending state for the callback.

@param r the reply to process.
vespaclient-core/src/main/java/com/yahoo/feedapi/SharedSender.java