Skip to content

Commit 3882bf9

Browse files
committed
Added BatchLoaderScheduler into the mix- doco update
1 parent 32ce3cb commit 3882bf9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ in the load request queue will never be batched, and thus _will never complete_!
512512

513513
## The BatchLoader Scheduler
514514

515-
By default, when `dataLoader.dispatch()` is called the `BatchLoader` / `MappedBatchLoader` function will be invoked
515+
By default, when `dataLoader.dispatch()` is called, the `BatchLoader` / `MappedBatchLoader` function will be invoked
516516
immediately.
517517

518518
However, you can provide your own `BatchLoaderScheduler` that allows this call to be done some time into
@@ -553,6 +553,8 @@ each batch of keys.
553553

554554
Do not assume that a single call to `dispatch()` results in a single call to `BatchLoaderScheduler`.
555555

556+
This code is inspired from the scheduling code in the [reference JS implementation](https://github.com/graphql/dataloader#batch-scheduling)
557+
556558
## Scheduled Registry Dispatching
557559

558560
`ScheduledDataLoaderRegistry` is a registry that allows for dispatching to be done on a schedule. It contains a

src/main/java/org/dataloader/scheduler/BatchLoaderScheduler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import java.util.concurrent.CompletionStage;
1212

1313
/**
14-
* By default, when {@link DataLoader#dispatch()} is called the {@link BatchLoader} / {@link MappedBatchLoader} function will be invoked
14+
* By default, when {@link DataLoader#dispatch()} is called, the {@link BatchLoader} / {@link MappedBatchLoader} function will be invoked
1515
* immediately. However, you can provide your own {@link BatchLoaderScheduler} that allows this call to be done some time into
1616
* the future. You will be passed a callback ({@link ScheduledBatchLoaderCall} / {@link ScheduledMappedBatchLoaderCall} and you are expected
1717
* to eventually call this callback method to make the batch loading happen.

0 commit comments

Comments
 (0)