Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 1.29 KB

README.md

File metadata and controls

39 lines (26 loc) · 1.29 KB

dataloader

(under construction)

Build Status Maven Central Javadocs

A java version of the dataloader pattern.

This is my take of the facebook dataloader pattern.

Similar to the java-dataloader but it is not graphql related.

Wrap a batch api, and allow multiple requests to be batched under the hood. This is a reactor-based dataloader

usage

mvn dependency

<dependency>
  <groupId>io.github.steliospaps</groupId>
  <artifactId>dataloader</artifactId>
  <version>xxx</version>
</dependency>

examples

simple

DataLoader<String,Integer> dataloader = ReactorDataLoader.create(list -> list.stream().map(i -> "result"+i).collect(Collectors.toList()));

CompletableFuture<String> result= dataloader.load(1);
// result.get() will yield "result1"

result in the example above will eventually complete.