File tree 1 file changed +17
-0
lines changed
sb3-mt-samples/src/main/java/com/ashfaq/example/bulkoperation
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -213,4 +213,21 @@ public void processBatch(List<PlanRequest> planRequests) {
213
213
// If there are still tasks left (let's say 10), they will be placed in the queue.
214
214
// If the queue is full (100 tasks), and additional tasks come in, the calling thread will start processing them (because of CallerRunsPolicy).
215
215
216
+
217
+ //same with completable future and executor service config as we can Chaining of Dependent Tasks, Non-Blocking Callback Handling ......
218
+ // public CompletableFuture<Void> processBatchAsync(List<PlanRequest> planRequests) {
219
+ // return CompletableFuture.allOf(
220
+ // planRequests.stream()
221
+ // .map(planRequest -> CompletableFuture.supplyAsync(() -> processRowAction(planRequest), executorService)
222
+ // .thenAccept(success -> {
223
+ // if (success) {
224
+ // // Handle success logic here, such as logging or status update
225
+ // } else {
226
+ // // Handle failure logic here
227
+ // }
228
+ // }))
229
+ // .toArray(CompletableFuture[]::new)
230
+ // );
231
+ // }
232
+
216
233
}
You can’t perform that action at this time.
0 commit comments