Package org.dataloader
Interface MappedBatchPublisherWithContext<K,V>
-
@PublicSpi @NullMarked public interface MappedBatchPublisherWithContext<K,V>
This form ofMappedBatchPublisher
is given aBatchLoaderEnvironment
object that encapsulates the calling context. A typical use case is passing in security credentials or database details for example.See
MappedBatchPublisher
for more details on the design invariants that you must implement in order to use this interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
load(java.util.List<K> keys, org.reactivestreams.Subscriber<java.util.Map.Entry<K,V>> subscriber, BatchLoaderEnvironment environment)
Called to batch the provided keys into a stream of map entries of keys and values.
-
-
-
Method Detail
-
load
void load(java.util.List<K> keys, org.reactivestreams.Subscriber<java.util.Map.Entry<K,V>> subscriber, BatchLoaderEnvironment environment)
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
.This is given an environment object to that maybe be useful during the call. A typical use case is passing in security credentials or database details for example.
- Parameters:
keys
- the collection of keys to loadsubscriber
- as values arrive you must call the subscriber for each valueenvironment
- an environment object that can help with the call
-
-