org.infinispan.commons.util.concurrent.NotifyingFuture Maven / Gradle / Ivy
package org.infinispan.commons.util.concurrent;
import java.util.concurrent.Future;
/**
* A sub-interface of a Future, that allows for listeners to be attached so that observers can be notified of when the
* future completes.
*
* See {@link FutureListener} for more details.
*
* {@link #attachListener(FutureListener)} returns the same future instance, which is useful for 'building' a future.
* E.g.,
*
* Future f = cache.clearAsync().attachListener(new MyCustomListener());
*
* @author Manik Surtani
* @since 4.0
*/
public interface NotifyingFuture extends Future {
/**
* Attaches a listener and returns the same future instance, to allow for 'building'.
*
* @param listener listener to attach
* @return the same future instance
*/
NotifyingFuture attachListener(FutureListener listener);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy