public interface BatchGetResultPagePublisher extends SdkPublisher<BatchGetResultPage>
DynamoDbEnhancedAsyncClient.batchGetItem(software.amazon.awssdk.enhanced.dynamodb.model.BatchGetItemEnhancedRequest)
operation.
You can either subscribe to the BatchGetResultPage
s or flattened items across all pages via
resultsForTable(MappedTableResource)
.
Example:
1) Subscribing to BatchGetResultPage
s
batchGetResultPagePublisher.subscribe(page -> {
page.resultsForTable(firstItemTable).forEach(item -> System.out.println(item));
page.resultsForTable(secondItemTable).forEach(item -> System.out.println(item));
});
2) Subscribing to results across all pages.
batchGetResultPagePublisher.resultsForTable(firstItemTable).subscribe(item -> System.out.println(item));
batchGetResultPagePublisher.resultsForTable(secondItemTable).subscribe(item -> System.out.println(item));
Modifier and Type | Method and Description |
---|---|
static BatchGetResultPagePublisher |
create(SdkPublisher<BatchGetResultPage> publisher)
Creates a flattened items publisher with the underlying page publisher.
|
default <T> SdkPublisher<T> |
resultsForTable(MappedTableResource<T> mappedTable)
Returns a publisher that can be used to request a stream of results belonging to the supplied table across all pages.
|
adapt, buffer, filter, filter, flatMapIterable, limit, map, subscribe
static BatchGetResultPagePublisher create(SdkPublisher<BatchGetResultPage> publisher)
default <T> SdkPublisher<T> resultsForTable(MappedTableResource<T> mappedTable)
This method is useful if you are interested in subscribing to the items in all response pages instead of the top level pages.
T
- the type of the table itemsmappedTable
- the table to retrieve items forSdkPublisher
Copyright © 2020. All rights reserved.