pl.allegro.tech.hermes.consumers.queue.WaitFreeDrainMpscQueue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hermes-consumers Show documentation
Show all versions of hermes-consumers Show documentation
Fast and reliable message broker built on top of Kafka.
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