Class BatchLoaderHandlerMethod


public class BatchLoaderHandlerMethod extends InvocableHandlerMethodSupport
An extension of HandlerMethod for annotated handler methods adapted to BatchLoaderWithContext or MappedBatchLoaderWithContext with the list of keys and BatchLoaderEnvironment as their input.
Since:
1.0.0
Author:
Rossen Stoyanchev
  • Constructor Details

  • Method Details

    • invokeForMap

      @Nullable public <K, V> reactor.core.publisher.Mono<Map<K,V>> invokeForMap(Collection<K> keys, org.dataloader.BatchLoaderEnvironment environment)
      Invoke the underlying batch loader method with a collection of keys to return a Map of key-value pairs.
      Type Parameters:
      K - the type of keys in the map
      V - the type of values in the map
      Parameters:
      keys - the keys for which to load values
      environment - the environment available to batch loaders
      Returns:
      a Mono with map of key-value pairs.
    • invokeForIterable

      public <V> reactor.core.publisher.Flux<V> invokeForIterable(Collection<?> keys, org.dataloader.BatchLoaderEnvironment environment)
      Invoke the underlying batch loader method with a collection of input keys to return a collection of matching values.
      Type Parameters:
      V - the type of values returned
      Parameters:
      keys - the keys for which to load values
      environment - the environment available to batch loaders
      Returns:
      a Flux of values.