AutoCloseable
, CachedSupplier.PrefetchStrategy
public class NonBlocking extends Object implements CachedSupplier.PrefetchStrategy
CachedSupplier.PrefetchStrategy
that will run a single thread in the background to update the value. A call to
prefetch on this strategy will never return.
Multiple calls to prefetch(Runnable)
will still only result in one background task performing the update.Constructor | Description |
---|---|
NonBlocking(String asyncThreadName) |
Create a non-blocking prefetch strategy that uses the provided value for the name of the background thread that will be
performing the update.
|
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
Free any resources associated with the strategy.
|
void |
prefetch(Runnable valueUpdater) |
Execute the provided value updater to update the cache.
|
public NonBlocking(String asyncThreadName)
public void prefetch(Runnable valueUpdater)
CachedSupplier.PrefetchStrategy
prefetch
in interface CachedSupplier.PrefetchStrategy
public void close()
CachedSupplier.PrefetchStrategy
CachedSupplier.close()
method is
invoked.close
in interface AutoCloseable
close
in interface CachedSupplier.PrefetchStrategy
Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.