INNER CODE UNIT · Java

BatchExecutorQueue

apache/dubbo · dubbo-common/src/main/java/org/apache/dubbo/common/BatchExecutorQueue.java:25

public class BatchExecutorQueue<T> {

    static final int DEFAULT_QUEUE_SIZE = 128;
    private final Queue<T> queue;
    private final AtomicBoolean scheduled;
    private final int chunkSize;

    public BatchExecutorQueue() {
        this(DEFAULT_QUEUE_SIZE);
    }

    public BatchExecutorQueue(int chunkSize) {
        this.queue = new ConcurrentLinkedQueue<>();
        this.scheduled = new AtomicBoolean(false);
        this.chunkSize = chunkSize;
    }

    public void enqueue(T message, Executor executor) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…