From 6c0962d33e3c671b18d09da7770fe8df9c83c5b0 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sat, 21 Oct 2023 02:29:16 +0800 Subject: replace LinkedBlockingDeque with ArrayBlockingQueue in SubmitWorker --- src/main/java/com/keuin/blame/SubmitWorker.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/com/keuin/blame/SubmitWorker.java b/src/main/java/com/keuin/blame/SubmitWorker.java index 5d565f7..78763a1 100644 --- a/src/main/java/com/keuin/blame/SubmitWorker.java +++ b/src/main/java/com/keuin/blame/SubmitWorker.java @@ -8,8 +8,8 @@ import com.mongodb.client.MongoClients; import com.mongodb.client.MongoCollection; import com.mongodb.client.MongoDatabase; +import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; -import java.util.concurrent.LinkedBlockingDeque; import java.util.logging.Logger; public class SubmitWorker { @@ -17,7 +17,7 @@ public class SubmitWorker { public static final SubmitWorker INSTANCE = new SubmitWorker(); private final Logger logger = Logger.getLogger(SubmitWorker.class.getName()); - private final BlockingQueue queue = new LinkedBlockingDeque<>(4096); + private final BlockingQueue queue = new ArrayBlockingQueue<>(4096); private final Thread thread = new Thread(SubmitWorker.this::run); private boolean run = true; -- cgit v1.2.3