Skip to content

Commit 42627e5

Browse files
committed
Update documentation to remove scheduled executor and batch window
1 parent 973c915 commit 42627e5

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

documentation/batching.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,7 @@ DataFetcher<CompletableFuture<Object>> df1 = env -> {
389389
### How do I enable Chained DataLoaders?
390390
You must opt-in to Chained DataLoaders via `GraphQLUnusualConfiguration.DataloaderConfig`, as this may change order of dispatching.
391391

392-
1. Set `enableDataLoaderChaining(true)` to enable Chained DataLoaders
393-
2. Provide a `ScheduledExecutorService` to GraphQL Java, with method `delayedDataLoaderExecutorFactory` and a parameter that implements `DelayedDataLoaderDispatcherExecutorFactory`
392+
Set `enableDataLoaderChaining(true)` to enable Chained DataLoaders.
394393

395394
For example, to set `enableDataLoaderChaining`:
396395
```java
@@ -410,7 +409,7 @@ Note: The GraphQL Java engine can only optimally calculate DataLoader dispatches
410409

411410
### A special case: Delayed DataLoaders
412411

413-
In a previous code snippet we demonstrated one DataLoader depending on another DataLoader.
412+
In a previous code snippet, we demonstrated one DataLoader depending on another DataLoader.
414413

415414
Another special case is a "delayed" DataLoader, where a DataLoader depends on a slow async task instead. For example, here are two DataFetchers from [a test example](https://github.com/graphql-java/graphql-java/blob/master/src/test/groovy/graphql/ChainedDataLoaderTest.groovy):
416415

@@ -434,8 +433,4 @@ def barDF = { env ->
434433
} as DataFetcher
435434
```
436435

437-
By opting in to Chained DataLoaders, GraphQL Java will also calculate when to dispatch "delayed" DataLoaders.
438-
439-
The default value for the time to wait for these "delayed" DataLoaders is 500,000ns (`DEFAULT_BATCH_WINDOW_NANO_SECONDS_DEFAULT`). If you like, you can configure your own batch window via the method `delayedDataLoaderBatchWindowSize` in `GraphQLUnusualConfiguration.DataloaderConfig`.
440-
441-
Note that the case, where one DataLoader depends on another DataLoader all within the same DataFetcher, is unaffected by this batch window configuration. This window configuration only changes how long to wait for the "delayed" DataLoader case, where a DataLoader depends on another async task.
436+
By opting in to Chained DataLoaders, GraphQL Java will also calculate when to dispatch "delayed" DataLoaders. These "delayed" DataLoaders will be enqueued for dispatch after the async task completes.

0 commit comments

Comments
 (0)