diff --git a/redisson/src/main/java/org/redisson/api/RFuture.java b/redisson/src/main/java/org/redisson/api/RFuture.java index bbe9c6005..bc0a1c0f6 100644 --- a/redisson/src/main/java/org/redisson/api/RFuture.java +++ b/redisson/src/main/java/org/redisson/api/RFuture.java @@ -76,26 +76,85 @@ public interface RFuture extends java.util.concurrent.Future { */ 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 addListener(FutureListener 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 addListeners(FutureListener... 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 removeListener(FutureListener 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 removeListeners(FutureListener... listeners); - boolean isCancellable(); - + /** + * Waits for this future until it is done, and rethrows the cause of the failure if this future + * failed. + */ RFuture sync() throws InterruptedException; + /** + * Waits for this future until it is done, and rethrows the cause of the failure if this future + * failed. + */ RFuture syncUninterruptibly(); + /** + * Waits for this future to be completed. + * + * @throws InterruptedException + * if the current thread was interrupted + */ RFuture await() throws InterruptedException; + /** + * Waits for this future to be completed without + * interruption. This method catches an {@link InterruptedException} and + * discards it silently. + */ RFuture 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); + /** + * 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);