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

org.noear.water.protocol.MsgQueue Maven / Gradle / Ivy

There is a newer version: 2.14.2
Show newest version
package org.noear.water.protocol;

import java.io.Closeable;
import java.util.function.Consumer;

/**
 * 消息队列接口(发到队列里的消息,是原消息ID)
 * */
public interface MsgQueue extends Closeable {
    /**
     * 添加一个消息
     * */
    boolean push(String msg_id) ;

    /**
     * 返问并移除队列头部的消息
     * */
    String poll();

    /**
     * 返问并移除队列头部的消息(以回调形式处理)
     * */
    void pollGet(Consumer callback);

    /**
     * 数量
     * */
    long count();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy