|
|
@ -76,26 +76,85 @@ public interface RFuture<V> extends java.util.concurrent.Future<V> {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
boolean await(long timeoutMillis) throws InterruptedException;
|
|
|
|
boolean await(long timeoutMillis) throws InterruptedException;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Adds the specified listener to this future. The
|
|
|
|
|
|
|
|
* specified listener is notified when this future is
|
|
|
|
|
|
|
|
* {@linkplain #isDone() done}. If this future is already
|
|
|
|
|
|
|
|
* completed, the specified listener is notified immediately.
|
|
|
|
|
|
|
|
*/
|
|
|
|
RFuture<V> addListener(FutureListener<? super V> listener);
|
|
|
|
RFuture<V> addListener(FutureListener<? super V> listener);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Adds the specified listeners to this future. The
|
|
|
|
|
|
|
|
* specified listeners are notified when this future is
|
|
|
|
|
|
|
|
* {@linkplain #isDone() done}. If this future is already
|
|
|
|
|
|
|
|
* completed, the specified listeners are notified immediately.
|
|
|
|
|
|
|
|
*/
|
|
|
|
RFuture<V> addListeners(FutureListener<? super V>... listeners);
|
|
|
|
RFuture<V> addListeners(FutureListener<? super V>... listeners);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Removes the first occurrence of the specified listener from this future.
|
|
|
|
|
|
|
|
* The specified listener is no longer notified when this
|
|
|
|
|
|
|
|
* future is {@linkplain #isDone() done}. If the specified
|
|
|
|
|
|
|
|
* listener is not associated with this future, this method
|
|
|
|
|
|
|
|
* does nothing and returns silently.
|
|
|
|
|
|
|
|
*/
|
|
|
|
RFuture<V> removeListener(FutureListener<? super V> listener);
|
|
|
|
RFuture<V> removeListener(FutureListener<? super V> listener);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Removes the first occurrence for each of the listeners from this future.
|
|
|
|
|
|
|
|
* The specified listeners are no longer notified when this
|
|
|
|
|
|
|
|
* future is {@linkplain #isDone() done}. If the specified
|
|
|
|
|
|
|
|
* listeners are not associated with this future, this method
|
|
|
|
|
|
|
|
* does nothing and returns silently.
|
|
|
|
|
|
|
|
*/
|
|
|
|
RFuture<V> removeListeners(FutureListener<? super V>... listeners);
|
|
|
|
RFuture<V> removeListeners(FutureListener<? super V>... listeners);
|
|
|
|
|
|
|
|
|
|
|
|
boolean isCancellable();
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Waits for this future until it is done, and rethrows the cause of the failure if this future
|
|
|
|
|
|
|
|
* failed.
|
|
|
|
|
|
|
|
*/
|
|
|
|
RFuture<V> sync() throws InterruptedException;
|
|
|
|
RFuture<V> sync() throws InterruptedException;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Waits for this future until it is done, and rethrows the cause of the failure if this future
|
|
|
|
|
|
|
|
* failed.
|
|
|
|
|
|
|
|
*/
|
|
|
|
RFuture<V> syncUninterruptibly();
|
|
|
|
RFuture<V> syncUninterruptibly();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Waits for this future to be completed.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @throws InterruptedException
|
|
|
|
|
|
|
|
* if the current thread was interrupted
|
|
|
|
|
|
|
|
*/
|
|
|
|
RFuture<V> await() throws InterruptedException;
|
|
|
|
RFuture<V> await() throws InterruptedException;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Waits for this future to be completed without
|
|
|
|
|
|
|
|
* interruption. This method catches an {@link InterruptedException} and
|
|
|
|
|
|
|
|
* discards it silently.
|
|
|
|
|
|
|
|
*/
|
|
|
|
RFuture<V> awaitUninterruptibly();
|
|
|
|
RFuture<V> awaitUninterruptibly();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Waits for this future to be completed within the
|
|
|
|
|
|
|
|
* specified time limit without interruption. This method catches an
|
|
|
|
|
|
|
|
* {@link InterruptedException} and discards it silently.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @return {@code true} if and only if the future was completed within
|
|
|
|
|
|
|
|
* the specified time limit
|
|
|
|
|
|
|
|
*/
|
|
|
|
boolean awaitUninterruptibly(long timeout, TimeUnit unit);
|
|
|
|
boolean awaitUninterruptibly(long timeout, TimeUnit unit);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Waits for this future to be completed within the
|
|
|
|
|
|
|
|
* specified time limit without interruption. This method catches an
|
|
|
|
|
|
|
|
* {@link InterruptedException} and discards it silently.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @return {@code true} if and only if the future was completed within
|
|
|
|
|
|
|
|
* the specified time limit
|
|
|
|
|
|
|
|
*/
|
|
|
|
boolean awaitUninterruptibly(long timeoutMillis);
|
|
|
|
boolean awaitUninterruptibly(long timeoutMillis);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|