diff --git a/pom.xml b/pom.xml
index 0c6fd12..de0ab08 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
common-utils
org.warp
- 1.0.4
+ 1.0.5
UTF-8
diff --git a/src/main/java/org/warp/commonutils/batch/ParallelUtils.java b/src/main/java/org/warp/commonutils/batch/ParallelUtils.java
index 74a91f8..6570988 100644
--- a/src/main/java/org/warp/commonutils/batch/ParallelUtils.java
+++ b/src/main/java/org/warp/commonutils/batch/ParallelUtils.java
@@ -3,6 +3,7 @@ package org.warp.commonutils.batch;
import java.util.concurrent.CompletionException;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicReference;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import org.warp.commonutils.concurrency.executor.BoundedExecutorService;
@@ -13,10 +14,10 @@ import org.warp.commonutils.type.VariableWrapper;
public class ParallelUtils {
- public static void parallelize(Consumer> iterator,
+ public static void parallelize(Consumer> iterator,
int maxQueueSize,
int parallelism,
- int groupSize, BiConsumer consumer) {
+ int groupSize, Consumer consumer) throws CompletionException {
var parallelExecutor = BoundedExecutorService.create(maxQueueSize,
parallelism,
parallelism,
@@ -27,23 +28,29 @@ public class ParallelUtils {
);
final int CHUNK_SIZE = groupSize;
IntWrapper count = new IntWrapper(CHUNK_SIZE);
- VariableWrapper