@FunctionalInterface public static interface CachedSupplier.PrefetchStrategy extends SdkAutoCloseable
RefreshResult.prefetchTime() arrives.OneCallerBlocks,
NonBlocking| Modifier and Type | Method and Description |
|---|---|
default void |
close()
Free any resources associated with the strategy.
|
default <T> RefreshResult<T> |
fetch(Supplier<RefreshResult<T>> supplier)
Invoke the provided supplier to retrieve the refresh result.
|
default void |
initializeCachedSupplier(CachedSupplier<?> cachedSupplier)
Invoked when the prefetch strategy is registered with a
CachedSupplier. |
void |
prefetch(Runnable valueUpdater)
Execute the provided value updater to update the cache.
|
void prefetch(Runnable valueUpdater)
default <T> RefreshResult<T> fetch(Supplier<RefreshResult<T>> supplier)
default void initializeCachedSupplier(CachedSupplier<?> cachedSupplier)
CachedSupplier.default void close()
CachedSupplier.close() method is
invoked.close in interface AutoCloseableclose in interface SdkAutoCloseableCopyright © 2023. All rights reserved.