Class TriggerFuture<T>

  • All Implemented Interfaces:
    Future<T>
    Direct Known Subclasses:
    TriggerSuccessFuture

    public abstract class TriggerFuture<T>
    extends Object
    implements Future<T>

    A Future wrapper that executes an abstract method with the result at some point after the data becomes available. A "best effort" is made to ensure execution, but it may be left untriggered until the end of a request.

    Notification will happen ONCE:

    • After get() is called
    • When the future is done and isDone() is called
    • At the end of a request that has the AsyncCacheFilter enabled.

    Use the AsyncCacheFilter for normal requests. For situations where a filter is not appropriate (ie, the remote api) be sure to call PendingFutures.completeAllPendingFutures() manually.

    Note that if you are using this with Objectify, you probably want to use ObjectifyFilter.complete() rather than PendingFutures or AsyncCacheFilter static methods.

    Author:
    Jeff Schnitzer