Interface BatchPublisher<K,V>
- 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
The function must call the provided Subscriber
to process the values 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).
NOTE: It is required that Subscriber.onNext(Object)
is invoked on each value in the same order as
the provided keys and that you provide a value for every key provided.
- See Also:
-
Method Summary
-
Method Details
-
load
Called to batch the provided keys into a stream of values. You must provide the same number of values as there as keys, and they must be in the order of the keys.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
.NOTE: It is required that
Subscriber.onNext(Object)
is invoked on each value in the same order as the provided keys and that you provide a value for every key provided.- Parameters:
keys
- the collection of keys to loadsubscriber
- as values arrive you must call the subscriber for each value
-