/** * looks up the corresponding {@code Invocation} that returns a * {@code Future}. Only Invokables that return {@code Futures} are annotated * in a way that can be parsed into an {@linkplain HttpRequest}. */ private Invocation toAsync(Invocation in) { Invocation async = sync2async.apply(in); checkState(isFuture(async.getInvokable()), "not a future: %s", async); return async; }
/** * looks up the corresponding {@code Invocation} that returns a * {@code Future}. Only Invokables that return {@code Futures} are annotated * in a way that can be parsed into an {@linkplain HttpRequest}. */ private Invocation toAsync(Invocation in) { Invocation async = sync2async.apply(in); checkState(isFuture(async.getInvokable()), "not a future: %s", async); return async; }
/** * looks up the corresponding {@code Invocation} that returns a * {@code Future}. Only Invokables that return {@code Futures} are annotated * in a way that can be parsed into an {@linkplain HttpRequest}. */ private Invocation toAsync(Invocation in) { Invocation async = sync2async.apply(in); checkState(isFuture(async.getInvokable()), "not a future: %s", async); return async; }
@Override public Object apply(Invocation in) { if (isFuture(in.getInvokable())) { return submit(in); } Invocation async = toAsync(in); Optional<Long> timeoutNanos = config.getTimeoutNanos(async); if (timeoutNanos.isPresent()) { return invokeWithTimeout(async, timeoutNanos.get()); } return invoke(async); }
@Override public Object apply(Invocation in) { if (isFuture(in.getInvokable())) { return submit(in); } Invocation async = toAsync(in); Optional<Long> timeoutNanos = config.getTimeoutNanos(async); if (timeoutNanos.isPresent()) { return invokeWithTimeout(async, timeoutNanos.get()); } return invoke(async); }
@Override public Object apply(Invocation in) { if (isFuture(in.getInvokable())) { return submit(in); } Invocation async = toAsync(in); Optional<Long> timeoutNanos = config.getTimeoutNanos(async); if (timeoutNanos.isPresent()) { return invokeWithTimeout(async, timeoutNanos.get()); } return invoke(async); }