File tree Expand file tree Collapse file tree 2 files changed +34
-4
lines changed
services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model Expand file tree Collapse file tree 2 files changed +34
-4
lines changed Original file line number Diff line number Diff line change 36
36
* batchGetResultPagePublisher.subscribe(page -> {
37
37
* page.resultsForTable(firstItemTable).forEach(item -> System.out.println(item));
38
38
* page.resultsForTable(secondItemTable).forEach(item -> System.out.println(item));
39
+ * }).exceptionally(failure -> {
40
+ * System.err.println("Failure occurred in subscription.");
41
+ * failure.printStackTrace();
42
+ * return null;
39
43
* });
40
44
* }
41
45
* </pre>
44
48
* 2) Subscribing to results across all pages.
45
49
* <pre>
46
50
* {@code
47
- * batchGetResultPagePublisher.resultsForTable(firstItemTable).subscribe(item -> System.out.println(item));
48
- * batchGetResultPagePublisher.resultsForTable(secondItemTable).subscribe(item -> System.out.println(item));
51
+ * CompletableFuture<Void> resultFuture1 =
52
+ * batchGetResultPagePublisher.resultsForTable(firstItemTable)
53
+ * .subscribe(item -> System.out.println(item));
54
+ *
55
+ * CompletableFuture<Void> resultFuture2 =
56
+ * batchGetResultPagePublisher.resultsForTable(secondItemTable)
57
+ * .subscribe(item -> System.out.println(item));
58
+ *
59
+ * resultFuture1.exceptionally(failure -> {
60
+ * System.err.println("Failure occurred in results for table " + firstItemTable);
61
+ * failure.printStackTrace();
62
+ * return null;
63
+ * });
64
+ *
65
+ * resultFuture2.exceptionally(failure -> {
66
+ * System.err.println("Failure occurred in results for table " + secondItemTable);
67
+ * failure.printStackTrace();
68
+ * return null;
69
+ * });
49
70
* }
50
71
* </pre>
51
72
*/
Original file line number Diff line number Diff line change 31
31
* {@code
32
32
*
33
33
* PagePublisher<MyItem> publisher = mappedTable.scan();
34
- * publisher.subscribe(page -> page.items().forEach(item -> System.out.println(item)));
34
+ * publisher.subscribe(page -> page.items().forEach(item -> System.out.println(item)))
35
+ * .exceptionally(failure -> {
36
+ * failure.printStackTrace();
37
+ * return null;
38
+ * });
35
39
* }
36
40
* </pre>
37
41
*
41
45
* {@code
42
46
*
43
47
* PagePublisher<MyItem> publisher = mappedTable.scan();
44
- * publisher.items().subscribe(item -> System.out.println(item));
48
+ * publisher.items()
49
+ * .subscribe(item -> System.out.println(item))
50
+ * .exceptionally(failure -> {
51
+ * failure.printStackTrace();
52
+ * return null;
53
+ * });
45
54
* }
46
55
* </pre>
47
56
*
You can’t perform that action at this time.
0 commit comments