Class CoalescingSupplier<T>

  • All Implemented Interfaces:
    java.util.function.Supplier<T>

    public class CoalescingSupplier<T>
    extends Object
    implements java.util.function.Supplier<T>
    A supplier that coalesces computation requests, such that only one computation is ever running at a time, and concurrent requests will result in a single computation. Computations are guaranteed to execute after being requested; requests will not receive results for computations that started prior to the request.
    • Constructor Detail

      • CoalescingSupplier

        public CoalescingSupplier​(java.util.function.Supplier<T> delegate)
    • Method Detail

      • get

        public T get()
        Specified by:
        get in interface java.util.function.Supplier<T>
      • getAsync

        public com.google.common.util.concurrent.ListenableFuture<T> getAsync()