MCPcopy Create free account
hub / github.com/antlr/codebuff / loadAsync

Method loadAsync

output/java_guava/1.4.13/LocalCache.java:2396–2410  ·  view source on GitHub ↗
(final K key, final int hash, final LoadingValueReference<K, V> loadingValueReference, CacheLoader<? super K, V> loader)

Source from the content-addressed store, hash-verified

2394 }
2395
2396 ListenableFuture<V> loadAsync(final K key, final int hash, final LoadingValueReference<K, V> loadingValueReference, CacheLoader<? super K, V> loader) {
2397 final ListenableFuture<V> loadingFuture = loadingValueReference.loadFuture(key, loader);
2398 loadingFuture.addListener(new Runnable() {
2399 @Override
2400 public void run() {
2401 try {
2402 getAndRecordStats(key, hash, loadingValueReference, loadingFuture);
2403 } catch (Throwable t) {
2404 logger.log(Level.WARNING, "Exception thrown during refresh", t);
2405 loadingValueReference.setException(t);
2406 }
2407 }
2408 }, directExecutor());
2409 return loadingFuture;
2410 }
2411
2412 /**
2413 * Waits uninterruptibly for {@code newValue} to be loaded, and then records loading stats.

Callers 1

refreshMethod · 0.95

Calls 3

addListenerMethod · 0.65
loadFutureMethod · 0.45
directExecutorMethod · 0.45

Tested by

no test coverage detected