Package org.dataloader
Interface MappedBatchPublisher<K,V extends @Nullable Object>
- Type Parameters:
K
- type parameter indicating the type of keys to use for data load requests.V
- type parameter indicating the type of values returned
A function that is invoked for batch loading a stream of data values indicated by the provided list of keys.
The function must call the provided Subscriber
to process the key/value pairs it has retrieved to allow
the future returned by DataLoader.load(Object)
to complete as soon as the individual value is available
(rather than when all values have been retrieved).
- See Also:
-
Method Summary
-
Method Details
-
load
Called to batch the provided keys into a stream of map entries of keys and values.The idiomatic approach would be to create a reactive
Publisher
that provides the values given the keys and then subscribe to it with the providedSubscriber
.- Parameters:
keys
- the collection of keys to loadsubscriber
- as values arrive you must call the subscriber for each value
-