Package io.netty.util.concurrent
Interface ProgressivePromise<V>
-
- All Superinterfaces:
Future<V>,java.util.concurrent.Future<V>,ProgressiveFuture<V>,Promise<V>
- All Known Subinterfaces:
ChannelProgressivePromise
- All Known Implementing Classes:
DefaultChannelProgressivePromise,DefaultProgressivePromise
public interface ProgressivePromise<V> extends Promise<V>, ProgressiveFuture<V>
SpecialProgressiveFuturewhich is writable.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ProgressivePromise<V>addListener(GenericFutureListener<? extends Future<? super V>> listener)Adds the specified listener to this future.ProgressivePromise<V>addListeners(GenericFutureListener<? extends Future<? super V>>... listeners)Adds the specified listeners to this future.ProgressivePromise<V>await()Waits for this future to be completed.ProgressivePromise<V>awaitUninterruptibly()Waits for this future to be completed without interruption.ProgressivePromise<V>removeListener(GenericFutureListener<? extends Future<? super V>> listener)Removes the first occurrence of the specified listener from this future.ProgressivePromise<V>removeListeners(GenericFutureListener<? extends Future<? super V>>... listeners)Removes the first occurrence for each of the listeners from this future.ProgressivePromise<V>setFailure(java.lang.Throwable cause)Marks this future as a failure and notifies all listeners.ProgressivePromise<V>setProgress(long progress, long total)Sets the current progress of the operation and notifies the listeners that implementGenericProgressiveFutureListener.ProgressivePromise<V>setSuccess(V result)Marks this future as a success and notifies all listeners.ProgressivePromise<V>sync()Waits for this future until it is done, and rethrows the cause of the failure if this future failed.ProgressivePromise<V>syncUninterruptibly()Waits for this future until it is done, and rethrows the cause of the failure if this future failed.booleantryProgress(long progress, long total)Tries to set the current progress of the operation and notifies the listeners that implementGenericProgressiveFutureListener.-
Methods inherited from interface io.netty.util.concurrent.Future
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isSuccess
-
Methods inherited from interface io.netty.util.concurrent.Promise
setUncancellable, tryFailure, trySuccess
-
-
-
-
Method Detail
-
setProgress
ProgressivePromise<V> setProgress(long progress, long total)
Sets the current progress of the operation and notifies the listeners that implementGenericProgressiveFutureListener.
-
tryProgress
boolean tryProgress(long progress, long total)Tries to set the current progress of the operation and notifies the listeners that implementGenericProgressiveFutureListener. If the operation is already complete or the progress is out of range, this method does nothing but returningfalse.
-
setSuccess
ProgressivePromise<V> setSuccess(V result)
Description copied from interface:PromiseMarks this future as a success and notifies all listeners. If it is success or failed already it will throw anIllegalStateException.- Specified by:
setSuccessin interfacePromise<V>
-
setFailure
ProgressivePromise<V> setFailure(java.lang.Throwable cause)
Description copied from interface:PromiseMarks this future as a failure and notifies all listeners. If it is success or failed already it will throw anIllegalStateException.- Specified by:
setFailurein interfacePromise<V>
-
addListener
ProgressivePromise<V> addListener(GenericFutureListener<? extends Future<? super V>> listener)
Description copied from interface:FutureAdds the specified listener to this future. The specified listener is notified when this future is done. If this future is already completed, the specified listener is notified immediately.- Specified by:
addListenerin interfaceFuture<V>- Specified by:
addListenerin interfaceProgressiveFuture<V>- Specified by:
addListenerin interfacePromise<V>
-
addListeners
ProgressivePromise<V> addListeners(GenericFutureListener<? extends Future<? super V>>... listeners)
Description copied from interface:FutureAdds the specified listeners to this future. The specified listeners are notified when this future is done. If this future is already completed, the specified listeners are notified immediately.- Specified by:
addListenersin interfaceFuture<V>- Specified by:
addListenersin interfaceProgressiveFuture<V>- Specified by:
addListenersin interfacePromise<V>
-
removeListener
ProgressivePromise<V> removeListener(GenericFutureListener<? extends Future<? super V>> listener)
Description copied from interface:FutureRemoves the first occurrence of the specified listener from this future. The specified listener is no longer notified when this future is done. If the specified listener is not associated with this future, this method does nothing and returns silently.- Specified by:
removeListenerin interfaceFuture<V>- Specified by:
removeListenerin interfaceProgressiveFuture<V>- Specified by:
removeListenerin interfacePromise<V>
-
removeListeners
ProgressivePromise<V> removeListeners(GenericFutureListener<? extends Future<? super V>>... listeners)
Description copied from interface:FutureRemoves the first occurrence for each of the listeners from this future. The specified listeners are no longer notified when this future is done. If the specified listeners are not associated with this future, this method does nothing and returns silently.- Specified by:
removeListenersin interfaceFuture<V>- Specified by:
removeListenersin interfaceProgressiveFuture<V>- Specified by:
removeListenersin interfacePromise<V>
-
await
ProgressivePromise<V> await() throws java.lang.InterruptedException
Description copied from interface:FutureWaits for this future to be completed.
-
awaitUninterruptibly
ProgressivePromise<V> awaitUninterruptibly()
Description copied from interface:FutureWaits for this future to be completed without interruption. This method catches anInterruptedExceptionand discards it silently.- Specified by:
awaitUninterruptiblyin interfaceFuture<V>- Specified by:
awaitUninterruptiblyin interfaceProgressiveFuture<V>- Specified by:
awaitUninterruptiblyin interfacePromise<V>
-
sync
ProgressivePromise<V> sync() throws java.lang.InterruptedException
Description copied from interface:FutureWaits for this future until it is done, and rethrows the cause of the failure if this future failed.
-
syncUninterruptibly
ProgressivePromise<V> syncUninterruptibly()
Description copied from interface:FutureWaits for this future until it is done, and rethrows the cause of the failure if this future failed.- Specified by:
syncUninterruptiblyin interfaceFuture<V>- Specified by:
syncUninterruptiblyin interfaceProgressiveFuture<V>- Specified by:
syncUninterruptiblyin interfacePromise<V>
-
-