Package com.palantir.common.concurrent
Class CoalescingSupplier<T>
- java.lang.Object
-
- com.palantir.common.concurrent.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 Summary
Constructors Constructor Description CoalescingSupplier(java.util.function.Supplier<T> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
get()
com.google.common.util.concurrent.ListenableFuture<T>
getAsync()
-