@Override public T actionGet() { return FutureUtils.get(this); }
@Override public T actionGet(long timeout, TimeUnit unit) { return FutureUtils.get(this, timeout, unit); }
private void notifyListener(ActionListener<V> listener, ExecutorService executorService) { try { executorService.submit(() -> { try { // call get in a non-blocking fashion as we could be on a network thread // or another thread like the scheduler, which we should never block! V value = FutureUtils.get(this, 0L, TimeUnit.NANOSECONDS); listener.onResponse(value); } catch (Exception e) { listener.onFailure(e); } }); } catch (Exception e) { listener.onFailure(e); } }
try (Releasable ignored = FutureUtils.get(permit)) {
@Override public T actionGet(long timeout, TimeUnit unit) { return FutureUtils.get(this, timeout, unit); }
@Override public T actionGet() { return FutureUtils.get(this); }
@Override public T actionGet(long timeout, TimeUnit unit) { return FutureUtils.get(this, timeout, unit); }
@Override public T actionGet() { return FutureUtils.get(this); }
private void notifyListener(ActionListener<V> listener, ExecutorService executorService) { try { executorService.submit(() -> { try { // call get in a non-blocking fashion as we could be on a network thread // or another thread like the scheduler, which we should never block! V value = FutureUtils.get(this, 0L, TimeUnit.NANOSECONDS); listener.onResponse(value); } catch (Exception e) { listener.onFailure(e); } }); } catch (Exception e) { listener.onFailure(e); } }
private void notifyListener(ActionListener<V> listener, ExecutorService executorService) { try { executorService.submit(() -> { try { // call get in a non-blocking fashion as we could be on a network thread // or another thread like the scheduler, which we should never block! V value = FutureUtils.get(this, 0L, TimeUnit.NANOSECONDS); listener.onResponse(value); } catch (Exception e) { listener.onFailure(e); } }); } catch (Exception e) { listener.onFailure(e); } }
try (Releasable ignored = FutureUtils.get(permit)) {
try (Releasable ignored = FutureUtils.get(permit)) {