Class PageCollector

java.lang.Object
dev.hogwai.dynamodb.simplified.internal.PageCollector

public final class PageCollector extends Object
Utility for bridging Reactive Streams page publishers to CompletableFuture.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> CompletableFuture<List<software.amazon.awssdk.enhanced.dynamodb.model.Page<T>>>
    collectPages(software.amazon.awssdk.core.async.SdkPublisher<software.amazon.awssdk.enhanced.dynamodb.model.Page<T>> publisher)
    Subscribes to a page publisher and collects all pages into a CompletableFuture list.
    static <T> CompletableFuture<List<software.amazon.awssdk.enhanced.dynamodb.model.Page<T>>>
    collectPages(software.amazon.awssdk.core.async.SdkPublisher<software.amazon.awssdk.enhanced.dynamodb.model.Page<T>> publisher, int prefetchLimit)
    Subscribes to a page publisher and collects all pages into a CompletableFuture list, using the specified prefetch limit to control backpressure.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • collectPages

      public static <T> CompletableFuture<List<software.amazon.awssdk.enhanced.dynamodb.model.Page<T>>> collectPages(software.amazon.awssdk.core.async.SdkPublisher<software.amazon.awssdk.enhanced.dynamodb.model.Page<T>> publisher)
      Subscribes to a page publisher and collects all pages into a CompletableFuture list.
      Type Parameters:
      T - the page item type
      Parameters:
      publisher - the page publisher to subscribe to
      Returns:
      a CompletableFuture that completes with the full list of collected pages
    • collectPages

      public static <T> CompletableFuture<List<software.amazon.awssdk.enhanced.dynamodb.model.Page<T>>> collectPages(software.amazon.awssdk.core.async.SdkPublisher<software.amazon.awssdk.enhanced.dynamodb.model.Page<T>> publisher, int prefetchLimit)
      Subscribes to a page publisher and collects all pages into a CompletableFuture list, using the specified prefetch limit to control backpressure.
      Type Parameters:
      T - the page item type
      Parameters:
      publisher - the page publisher to subscribe to
      prefetchLimit - the maximum number of pages to request upfront; maintains a window by requesting one additional page after each onNext
      Returns:
      a CompletableFuture that completes with the full list of collected pages