Skip to content

Commit

Permalink
Fix task batching doc to have the same code example.TaskBatchingMain
Browse files Browse the repository at this point in the history
  • Loading branch information
ryamagishi committed Jul 27, 2024
1 parent c4fdfcf commit 332262a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/task-batching.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class InsertHelloTask extends BatchingProcessor<HelloTask> {
@Override
protected void processBatchingTasks(List<BatchingTask<HelloTask>> batchingTasks) { // <2>
List<HelloTask> helloTasks =
batchingTasks.stream().map(BatchingTask::task).collect(Collectors.toList());
batchingTasks.stream().map(BatchingTask::task).collect(Collectors.toList());
// ... (Process helloTasks)
batchingTasks.forEach(batchingTask -> batchingTask.completion().complete()); // <3>
}
Expand All @@ -86,9 +86,11 @@ public class TaskBatchingMain {
.processorsBuilder(
ProcessorsBuilder
.consuming("my-decaton-topic", extractor)
.thenProcess(TaskBatchingMain.createBatchingProcessor(lingerMillis, capacity),
.thenProcess(() -> createBatchingProcessor(lingerMillis,
capacity),
ProcessorScope.THREAD)
)
// ... (Set up other options and build)
}
private static BatchingProcessor<HelloTask> createBatchingProcessor(long lingerMillis, int capacity) {
Expand Down

0 comments on commit 332262a

Please sign in to comment.