Class PendingFutures


  • public class PendingFutures
    extends Object

    This class maintains a thread local list of all the outstanding Future objects that have pending triggers. When a Future is done and its trigger is executed, it is removed from the list.

    Author:
    Jeff Schnitzer
    • Constructor Detail

      • PendingFutures

        public PendingFutures()
    • Method Detail

      • addPending

        public static void addPending​(Future<?> future)
        Register a pending Future that has a callback.
        Parameters:
        future - must have at least one callback
      • removePending

        public static void removePending​(Future<?> future)
        Deregister a pending Future that had a callback.
      • completeAllPendingFutures

        public static void completeAllPendingFutures()
        Iterate through all pending futures and get() them, forcing any callbacks to be called. This is used only by the AsyncCacheFilter (if using cache without Objectify) or ObjectifyFilter (if using Objectify normally) because we don't have a proper hook otherwise.