Skip to content

Commit d114a40

Browse files
committed
Doco tweaks
1 parent 5573995 commit d114a40

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ and Nicholas Schrock (@schrockn) from [Facebook](https://www.facebook.com/), the
5252
- Deals with partial errors when a batch future fails
5353
- Can disable batching and/or caching in configuration
5454
- Can supply your own [`CacheMap<K, V>`](https://github.com/graphql-java/java-dataloader/blob/master/src/main/java/io/engagingspaces/vertx/dataloader/CacheMap.java) implementations
55-
- Has very high test coverage (see [Acknowledgements](#acknowlegdements))
55+
- Has very high test coverage
5656

5757
## Examples
5858

@@ -399,17 +399,19 @@ and `NoOpStatisticsCollector`.
399399
If you are serving web requests then the data can be specific to the user requesting it. If you have user specific data
400400
then you will not want to cache data meant for user A to then later give it user B in a subsequent request.
401401

402-
The scope of your `DataLoader` instances is important. You might want to create them per web request to ensure data is only cached within that
402+
The scope of your `DataLoader` instances is important. You will want to create them per web request to ensure data is only cached within that
403403
web request and no more.
404404

405-
If your data can be shared across web requests then you might want to scope your data loaders so they survive longer than the web request say.
405+
If your data can be shared across web requests then use a custom cache to keep values in a common place.
406+
407+
Data loaders are stateful components that contain promises (with context) that are likely share the same affinity as the request.
406408

407409
## Custom caches
408410

409-
The default cache behind `DataLoader` is an in memory `HashMap`. There is no expiry on this and it lives for as long as the data loader
411+
The default cache behind `DataLoader` is an in memory `HashMap`. There is no expiry on this, and it lives for as long as the data loader
410412
lives.
411413

412-
However you can create your own custom cache and supply it to the data loader on construction via the `org.dataloader.CacheMap` interface.
414+
However, you can create your own custom cache and supply it to the data loader on construction via the `org.dataloader.CacheMap` interface.
413415

414416
```java
415417
MyCustomCache customCache = new MyCustomCache();

0 commit comments

Comments
 (0)