src/main/java/com/machinezoo/pushmode/PageExecutor.java
@Override
	public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
		if (tasks.isEmpty())
			throw new IllegalArgumentException();
		return submit(tasks.stream().findFirst().get()).get(timeout, unit);
	}
/**
	 * Blocks until the first supplied task completes running in the event loop or timeout expires.
	 * This method is provided for compatibility with {@link ExecutorService}.
	 * Call to this method is equivalent to calling {@link #submit(Callable)} and subsequently invoking {@link Future#get(long, TimeUnit)}.
	 * 
	 * @param tasks
	 *            Tasks to execute. {@link PageExecutor} ignores all but the first task.
	 * @param timeout
	 *            Timeout to wait for completion of the first task in units specified.
	 * @param unit
	 *            Unit of the timeout.
	 * @return Result of the first task.
	 * @x.threads This method is safe to call from any thread except the thread used by this {@link PageExecutor} where it would result in a deadlock.
	 *            This method blocks, which means it shouldn't be called from within event on any {@link PageExecutor}.
	 *            The first supplied task will run in the event loop, which means it doesn't need to synchronize access with other events in the same event loop.
	 * @see #submit(Callable)
	 */
Blocks until the first supplied task completes running in the event loop or timeout expires.
This method is provided for compatibility with  ExecutorService.
Call to this method is equivalent to calling  #submit(Callable) and subsequently invoking  Future#get(long, TimeUnit).

@param tasks
Tasks to execute.  PageExecutor ignores all but the first task.
@param timeout
Timeout to wait for completion of the first task in units specified.
@param unit
Unit of the timeout.
@return Result of the first task.
@x.threads This method is safe to call from any thread except the thread used by this  PageExecutor where it would result in a deadlock.
This method blocks, which means it shouldn't be called from within event on any  PageExecutor.
The first supplied task will run in the event loop, which means it doesn't need to synchronize access with other events in the same event loop.
Blocks until the first supplied task completes running in the event loop or timeout expires . This method is provided for compatibility with ExecutorService . Call to this method is equivalent to calling #submit ( Callable ) and subsequently invoking Future#get ( long TimeUnit ) . @param tasks Tasks to execute . PageExecutor ignores all but the first task . @param timeout Timeout to wait for completion of the first task in units specified . @param unit Unit of the timeout . @return Result of the first task . @x . threads This method is safe to call from any thread except the thread used by this PageExecutor where it would result in a deadlock . This method blocks which means it shouldn ' t be called from within event on any PageExecutor . The first supplied task will run in the event loop which means it doesn ' t need to synchronize access with other events in the same event loop .
@Override
	public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
		if (tasks.isEmpty())
			throw new IllegalArgumentException();
		return submit(tasks.stream().findFirst().get()).get(timeout, unit);
	}
@ Override public < T > T invokeAny ( Collection < ? extends Callable < T > > tasks , long timeout , TimeUnit unit ) throws InterruptedException , ExecutionException , TimeoutException { if ( tasks . isEmpty ( ) ) throw new IllegalArgumentException ( ) ; return submit ( tasks . stream ( ) . findFirst ( ) . get ( ) ) . get ( timeout , unit ) ; }
Blocks until the first supplied task completes running in the event loop or timeout expires.
Blocks until the first supplied task completes running in the event loop or timeout expires .