@Override public HttpClientRequest setTimeout(long timeoutMs) { synchronized (getLock()) { cancelOutstandingTimeoutTimer(); currentTimeoutTimerId = client.getVertx().setTimer(timeoutMs, id -> handleTimeout(timeoutMs)); return this; } }
private void cancelOutstandingTimeoutTimer() { if (currentTimeoutTimerId != -1) { client.getVertx().cancelTimer(currentTimeoutTimerId); currentTimeoutTimerId = -1; } }