Skip to content

Commit

Permalink
reorged method placement
Browse files Browse the repository at this point in the history
  • Loading branch information
bbakerman committed May 24, 2024
1 parent 6523015 commit 170ccf8
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions src/main/java/org/dataloader/DataLoaderHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -533,25 +533,6 @@ private CompletableFuture<List<V>> invokeBatchPublisher(List<K> keys, List<Objec
return loadResult;
}

private ReactiveSupport.HelperIntegration<K> helperIntegration() {
return new ReactiveSupport.HelperIntegration<>() {
@Override
public StatisticsCollector getStats() {
return stats;
}

@Override
public void clearCacheView(K key) {
dataLoader.clear(key);
}

@Override
public void clearCacheEntriesOnExceptions(List<K> keys) {
possiblyClearCacheEntriesOnExceptions(keys);
}
};
}

private CompletableFuture<List<V>> invokeMappedBatchPublisher(List<K> keys, List<Object> keyContexts, List<CompletableFuture<V>> queuedFutures, BatchLoaderEnvironment environment) {
CompletableFuture<List<V>> loadResult = new CompletableFuture<>();
Subscriber<Map.Entry<K, V>> subscriber = ReactiveSupport.mappedBatchSubscriber(loadResult, keys, keyContexts, queuedFutures, helperIntegration());
Expand Down Expand Up @@ -642,4 +623,22 @@ private static <T> DispatchResult<T> emptyDispatchResult() {
return (DispatchResult<T>) EMPTY_DISPATCH_RESULT;
}

private ReactiveSupport.HelperIntegration<K> helperIntegration() {
return new ReactiveSupport.HelperIntegration<>() {
@Override
public StatisticsCollector getStats() {
return stats;
}

@Override
public void clearCacheView(K key) {
dataLoader.clear(key);
}

@Override
public void clearCacheEntriesOnExceptions(List<K> keys) {
possiblyClearCacheEntriesOnExceptions(keys);
}
};
}
}

0 comments on commit 170ccf8

Please sign in to comment.