package com.xinda.mq.redischannel.queue;

import com.xinda.common.core.mq.DeviceReportBo;
import com.xinda.common.core.mq.message.DeviceDownMessage;
import com.xinda.common.core.mq.message.ModbusPollMsg;
import lombok.SneakyThrows;

import java.util.concurrent.LinkedBlockingQueue;

/**
 * 设备属性获取存储列队
 * @author gsb
 * @date 2022/10/11 8:29
 */
public class DevicePropFetchQueue {
    private static final LinkedBlockingQueue<ModbusPollMsg> queue = new LinkedBlockingQueue<>();

    /*元素加入队列,最后*/
    public static void offer(ModbusPollMsg dto){
        queue.offer(dto);
    }
    /*取出队列元素 先进先出*/
    @SneakyThrows
    public static ModbusPollMsg take(){
        return queue.take();
    }
}
