@Override public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException { return delegate.invokeAll(tasks, timeout, unit); }
@Override public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException { return delegate.invokeAll(tasks); }
@Override public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException { return service.invokeAll(tasks); }
@Override public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException { return service.invokeAll(tasks, timeout, unit); }
private void processTask() throws Exception { Collection<Callable<Void>> tasks = new LinkedList<Callable<Void>>(); do { Beat beat = taskQueue.poll(AbstractHealthCheckProcessor.CONNECT_TIMEOUT_MS / 2, TimeUnit.MILLISECONDS); if (beat == null) { return; } tasks.add(new TaskProcessor(beat)); } while (taskQueue.size() > 0 && tasks.size() < NIO_THREAD_COUNT * 64); for (Future<?> f : NIO_EXECUTOR.invokeAll(tasks)) { f.get(); } }
private void awaitAsynchronousCallbacksRun() throws Exception { // Make sure asynchronous callback got called (executor is single-threaded). executor.invokeAll(singletonList((Callable<?>) () -> null)); }
/** * {@inheritDoc} */ @Override public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException { submitted.mark(tasks.size()); Collection<? extends Callable<T>> instrumented = instrument(tasks); return delegate.invokeAll(instrumented, timeout, unit); }
/** * {@inheritDoc} */ @Override public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException { submitted.mark(tasks.size()); Collection<? extends Callable<T>> instrumented = instrument(tasks); return delegate.invokeAll(instrumented); }
/** * {@inheritDoc} */ @Nonnull @Override public <T> List<Future<T>> invokeAll(@Nonnull Collection<? extends Callable<T>> tasks, long timeout, @Nonnull TimeUnit unit) throws InterruptedException { submitted.mark(tasks.size()); Collection<? extends Callable<T>> instrumented = instrument(tasks); return delegate.invokeAll(instrumented, timeout, unit); }
/** * {@inheritDoc} */ @Nonnull @Override public <T> List<Future<T>> invokeAll(@Nonnull Collection<? extends Callable<T>> tasks) throws InterruptedException { submitted.mark(tasks.size()); Collection<? extends Callable<T>> instrumented = instrument(tasks); return delegate.invokeAll(instrumented); }
@Test @SuppressWarnings("unchecked") public void invokeAllTimeout() throws Exception { List<Future<Object>> exectedResult = Arrays.asList(expectedFutureObject); List<Callable<Object>> wrappedCallables = Arrays.asList(wrappedCallable); when(delegate.invokeAll(wrappedCallables, 1, TimeUnit.SECONDS)).thenReturn( exectedResult); List<Future<Object>> result = executor.invokeAll(Arrays.asList(callable), 1, TimeUnit.SECONDS); verify(delegate).invokeAll(wrappedCallables, 1, TimeUnit.SECONDS); assertThat(result).isEqualTo(exectedResult); }
@Test @SuppressWarnings("unchecked") public void invokeAll() throws Exception { List<Future<Object>> exectedResult = Arrays.asList(expectedFutureObject); List<Callable<Object>> wrappedCallables = Arrays.asList(wrappedCallable); when(delegate.invokeAll(wrappedCallables)).thenReturn(exectedResult); List<Future<Object>> result = executor.invokeAll(Arrays.asList(callable)); verify(delegate).invokeAll(wrappedCallables); assertThat(result).isEqualTo(exectedResult); }
@Test public void invokeAll1() throws InterruptedException { underTest.invokeAll(callables, timeout, SECONDS); verify(executorService).invokeAll(callables, timeout, SECONDS); }
@Test public void invokeAll() throws InterruptedException { underTest.invokeAll(callables); verify(executorService).invokeAll(callables); }
@Override public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException { List<TrackedCallable<T>> trackedTaskList = executorCore.registerCallableList(tasks); return executorCore.trackFutureList( executor.invokeAll(trackedTaskList), trackedTaskList ); }
@Override public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException { List<TrackedCallable<T>> trackedTaskList = executorCore.registerCallableList(tasks); return executorCore.trackFutureList( executor.invokeAll(trackedTaskList, timeout, unit), trackedTaskList ); }
@SuppressWarnings({ "rawtypes", "unchecked" }) public List invokeAll(Collection tasks, long timeout, TimeUnit unit) throws InterruptedException { return executorService.invokeAll(tasks, timeout, unit); }
public List<Future<T>> call() throws Exception { _invokeEntryCount.incrementAndGet(); try { return _current.get().invokeAll(tasks); } finally { _invokeEntryCount.decrementAndGet(); } }
public List<Future<T>> call() throws Exception { _invokeEntryCount.incrementAndGet(); try { return _current.get().invokeAll(tasks, timeout, unit); } finally { _invokeEntryCount.decrementAndGet(); } }
/** * {@inheritDoc} */ @Nonnull @Override public <T> List<Future<T>> invokeAll(@Nonnull Collection<? extends Callable<T>> tasks) throws InterruptedException { submitted.mark(tasks.size()); Collection<? extends Callable<T>> instrumented = instrument(tasks); return delegate.invokeAll(instrumented); }