Class Async
- java.lang.Object
-
- com.github.benmanes.caffeine.cache.Async
-
final class Async extends java.lang.Object
Static utility methods and classes pertaining to asynchronous operations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
Async.AsyncExpiry<K,V>
An expiry for asynchronous computations.(package private) static class
Async.AsyncRemovalListener<K,V>
A removal listener that asynchronously forwards the value stored in aCompletableFuture
if successful to the user-supplied removal listener.(package private) static class
Async.AsyncWeigher<K,V>
A weigher for asynchronous computations.
-
Field Summary
Fields Modifier and Type Field Description (package private) static long
ASYNC_EXPIRY
-
Constructor Summary
Constructors Modifier Constructor Description private
Async()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static <V> @Nullable V
getIfReady(@Nullable java.util.concurrent.CompletableFuture<V> future)
Returns the current value or null if either not done or failed.(package private) static <V> @Nullable V
getWhenSuccessful(@Nullable java.util.concurrent.CompletableFuture<V> future)
Returns the value when completed successfully or null if failed.(package private) static boolean
isReady(@Nullable java.util.concurrent.CompletableFuture<?> future)
Returns if the future has successfully completed.
-
-
-
Field Detail
-
ASYNC_EXPIRY
static final long ASYNC_EXPIRY
- See Also:
- Constant Field Values
-
-
Method Detail
-
isReady
static boolean isReady(@Nullable java.util.concurrent.CompletableFuture<?> future)
Returns if the future has successfully completed.
-
getIfReady
static <V> @Nullable V getIfReady(@Nullable java.util.concurrent.CompletableFuture<V> future)
Returns the current value or null if either not done or failed.
-
getWhenSuccessful
static <V> @Nullable V getWhenSuccessful(@Nullable java.util.concurrent.CompletableFuture<V> future)
Returns the value when completed successfully or null if failed.
-
-