public class CalculatingBlockingReference<T> extends Object
Supplier.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 and Description |
---|
CalculatingBlockingReference(Supplier<T> supplier) |
Modifier and Type | Method and Description |
---|---|
T |
get() |
static <T> CalculatingBlockingReference<T> |
make(Supplier<T> supplier) |
public T get() throws InterruptedException
InterruptedException
public static <T> CalculatingBlockingReference<T> make(Supplier<T> supplier)
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.