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