ru.qatools.mongodb.TailableQueue Maven / Gradle / Ivy
package ru.qatools.mongodb;
import java.util.function.Consumer;
/**
* @author Ilya Sadykov
*/
public interface TailableQueue {
/**
* Initialize the queue
*/
default void init() {
}
/**
* Drop the queue
*/
default void drop() {
}
/**
* Stop the processing of the messages
* This method makes sense only when there is an
* active poll process
*/
void stop();
/**
* Polls the queue and gives the control to consumer upom each incoming item within
*/
void poll(Consumer consumer);
/**
* Appends the new item to the queue
*/
void add(T object);
/**
* Returns the size of the queue (number of documents currently enqueued)
*/
long size();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy