/** * Return the minimum deadline of {@code this} or an other deadline. * @param other deadline to compare with {@code this}. */ public Deadline minimum(Deadline other) { assert this.ticker == other.ticker : "Tickers don't match"; return isBefore(other) ? this : other; }
/** * Return the minimum deadline of {@code this} or an other deadline. * @param other deadline to compare with {@code this}. */ public Deadline minimum(Deadline other) { return isBefore(other) ? this : other; }
Deadline oldDeadline = callOptions.getDeadline(); if (oldDeadline == null || newDeadline.isBefore(oldDeadline)) { callOptions = callOptions.withDeadline(newDeadline);
Deadline oldDeadline = callOptions.getDeadline(); if (oldDeadline == null || newDeadline.isBefore(oldDeadline)) { callOptions = callOptions.withDeadline(newDeadline);
protected <ReqT,R> ListenableFuture<R> fuCall(MethodDescriptor<ReqT,R> method, ReqT request, CallOptions callOptions, long timeoutMs) { if(timeoutMs <= 0L) timeoutMs = defaultTimeoutMs; if(timeoutMs > 0L) { Deadline deadline = callOptions.getDeadline(); Deadline timeoutDeadline = Deadline.after(timeoutMs, MILLISECONDS); if(deadline == null || timeoutDeadline.isBefore(deadline)) { callOptions = callOptions.withDeadline(timeoutDeadline); } else if(deadline.isExpired()) { return Futures.immediateFailedFuture( Status.DEADLINE_EXCEEDED.asRuntimeException()); } } final CallOptions callOpts = callOptions; return sendViaEventLoop && !isEventThread.satisfied() ? Futures.submitAsync(() -> fuCall(method, request, callOpts), ses) : fuCall(method, request, callOpts); }