package com.muyu.event.basics;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.concurrent.LinkedBlockingDeque;

/**
 * @author 刘武
 * @package：
 * @name：EventQueueConfig
 * @date：2024/9/29
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class EventQueueConfig {

    private LinkedBlockingDeque<EventProcessBasics> taskNodeQueue = new LinkedBlockingDeque<>();

    public void addEvent(EventProcessBasics obj){
        this.taskNodeQueue.add(obj);
    }

    public boolean hashEventNext(){
        return !taskNodeQueue.isEmpty();
    }

    private EventProcessBasics nextTaskNode(){
        return taskNodeQueue.poll();
    }
}
