Class OneCallerBlocks
- java.lang.Object
-
- software.amazon.awssdk.utils.cache.OneCallerBlocks
-
- All Implemented Interfaces:
AutoCloseable
,CachedSupplier.PrefetchStrategy
,SdkAutoCloseable
public class OneCallerBlocks extends Object implements CachedSupplier.PrefetchStrategy
ACachedSupplier.PrefetchStrategy
that will have one caller at a time block to update the value. Multiple calls toprefetch(Runnable)
will result in only one caller actually performing the update, with the others immediately returning.
-
-
Constructor Summary
Constructors Constructor Description OneCallerBlocks()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
prefetch(Runnable valueUpdater)
Execute the provided value updater to update the cache.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.cache.CachedSupplier.PrefetchStrategy
close, fetch, initializeCachedSupplier
-
-
-
-
Method Detail
-
prefetch
public void prefetch(Runnable valueUpdater)
Description copied from interface:CachedSupplier.PrefetchStrategy
Execute the provided value updater to update the cache. The specific implementation defines how this is invoked.- Specified by:
prefetch
in interfaceCachedSupplier.PrefetchStrategy
-
-