All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pl.allegro.tech.hermes.consumers.queue.WaitFreeDrainMpscQueue Maven / Gradle / Ivy

There is a newer version: 2.10.0
Show newest version
package pl.allegro.tech.hermes.consumers.queue;

import org.jctools.queues.MessagePassingQueue;
import org.jctools.queues.MpscArrayQueue;

public class WaitFreeDrainMpscQueue implements MpscQueue {

    private final MpscArrayQueue queue;

    public WaitFreeDrainMpscQueue(int capacity) {
        this.queue = new MpscArrayQueue<>(capacity);
    }

    @Override
    public boolean offer(T element) {
        return queue.offer(element);
    }

    @Override
    public void drain(MessagePassingQueue.Consumer consumer) {
        queue.drain(consumer);
    }

    @Override
    public int size() {
        return queue.size();
    }

    @Override
    public int capacity() {
        return queue.capacity();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy