Class PageCollector
java.lang.Object
dev.hogwai.dynamodb.simplified.internal.PageCollector
Utility for bridging Reactive Streams page publishers to CompletableFuture.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <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.
-
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 toprefetchLimit- 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
-