Package com.atlassian.bamboo.concurrent
Class CalculatingBlockingReference<T>
- java.lang.Object
-
- com.atlassian.bamboo.concurrent.CalculatingBlockingReference<T>
-
public class CalculatingBlockingReference<T> extends Object
Retrieves a reference from a supplier. IfSupplier.get()
method is currently NOT being executed, it is called to provide a value to return. Otherwise, instead of running parallel computations, the calling threads will wait until the current computation is completed. Then, they'll all get the same value from the originally running calculation.
-
-
Constructor Summary
Constructors Constructor Description CalculatingBlockingReference(Supplier<T> supplier)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description T
get()
static <T> CalculatingBlockingReference<T>
make(Supplier<T> supplier)
-
-
-
Method Detail
-
get
public T get() throws InterruptedException
- Throws:
InterruptedException
-
make
public static <T> CalculatingBlockingReference<T> make(Supplier<T> supplier)
-
-