3
3
import org .dataloader .annotations .GuardedBy ;
4
4
import org .dataloader .annotations .Internal ;
5
5
import org .dataloader .impl .CompletableFutureKit ;
6
- import org .dataloader .reactive .HelperIntegration ;
7
- import org .dataloader .reactive .MappedBatchSubscriber ;
8
- import org .dataloader .reactive .BatchSubscriber ;
6
+ import org .dataloader .reactive .ReactiveSupport ;
9
7
import org .dataloader .scheduler .BatchLoaderScheduler ;
10
8
import org .dataloader .stats .StatisticsCollector ;
11
9
import org .dataloader .stats .context .IncrementBatchLoadCountByStatisticsContext ;
@@ -510,7 +508,7 @@ private CompletableFuture<List<V>> invokeMapBatchLoader(List<K> keys, BatchLoade
510
508
511
509
private CompletableFuture <List <V >> invokeBatchPublisher (List <K > keys , List <Object > keyContexts , List <CompletableFuture <V >> queuedFutures , BatchLoaderEnvironment environment ) {
512
510
CompletableFuture <List <V >> loadResult = new CompletableFuture <>();
513
- Subscriber <V > subscriber = new BatchSubscriber <> (loadResult , keys , keyContexts , queuedFutures , helperIntegration ());
511
+ Subscriber <V > subscriber = ReactiveSupport . batchSubscriber (loadResult , keys , keyContexts , queuedFutures , helperIntegration ());
514
512
515
513
BatchLoaderScheduler batchLoaderScheduler = loaderOptions .getBatchLoaderScheduler ();
516
514
if (batchLoadFunction instanceof BatchPublisherWithContext ) {
@@ -535,8 +533,8 @@ private CompletableFuture<List<V>> invokeBatchPublisher(List<K> keys, List<Objec
535
533
return loadResult ;
536
534
}
537
535
538
- private HelperIntegration <K > helperIntegration () {
539
- return new HelperIntegration <>() {
536
+ private ReactiveSupport . HelperIntegration <K > helperIntegration () {
537
+ return new ReactiveSupport . HelperIntegration <>() {
540
538
@ Override
541
539
public StatisticsCollector getStats () {
542
540
return stats ;
@@ -556,7 +554,7 @@ public void clearCacheEntriesOnExceptions(List<K> keys) {
556
554
557
555
private CompletableFuture <List <V >> invokeMappedBatchPublisher (List <K > keys , List <Object > keyContexts , List <CompletableFuture <V >> queuedFutures , BatchLoaderEnvironment environment ) {
558
556
CompletableFuture <List <V >> loadResult = new CompletableFuture <>();
559
- Subscriber <Map .Entry <K , V >> subscriber = new MappedBatchSubscriber <> (loadResult , keys , keyContexts , queuedFutures , helperIntegration ());
557
+ Subscriber <Map .Entry <K , V >> subscriber = ReactiveSupport . mappedBatchSubscriber (loadResult , keys , keyContexts , queuedFutures , helperIntegration ());
560
558
561
559
BatchLoaderScheduler batchLoaderScheduler = loaderOptions .getBatchLoaderScheduler ();
562
560
if (batchLoadFunction instanceof MappedBatchPublisherWithContext ) {
0 commit comments