Class DeferredCallable<D,​P>

  • Type Parameters:
    D - Type used as return type of Callable.call(), and Deferred.resolve(Object)
    P - Type used for Deferred.notify(Object)
    All Implemented Interfaces:
    java.util.concurrent.Callable<D>

    public abstract class DeferredCallable<D,​P>
    extends java.lang.Object
    implements java.util.concurrent.Callable<D>
    Use this as superclass in case you need to be able to return a result and notify progress. If you don't need to notify progress, you can simply use Callable
    See Also:
    notify(Object)
    • Constructor Detail

      • DeferredCallable

        public DeferredCallable()
        Creates a new DeferredCallable with DEFAULT startPolicy.
      • DeferredCallable

        public DeferredCallable​(DeferredManager.StartPolicy startPolicy)
        Creates a new DeferredCallable with the given startPolicy.
        Parameters:
        startPolicy - the startPolicy to use. will be set to DEFAULT if null.
    • Method Detail

      • notify

        protected void notify​(P progress)
        Trigger notification of an intermediate result.
        Parameters:
        progress - the value to be sent as a notification
        See Also:
        Deferred.notify(Object)
      • getDeferred

        protected Deferred<D,​java.lang.Throwable,​P> getDeferred()