package com.lanyuanxiaoyao.service.queue.configuration;

import com.lanyuanxiaoyao.service.configuration.entity.queue.QueueItem;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.concurrent.PriorityBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;

/**
 * @author lanyuanxiaoyao
 * @date 2023-05-06
 */
public interface Constants {
    AtomicBoolean AUTO_SAVE = new AtomicBoolean(false);

    ConcurrentHashMap<String, ConcurrentLinkedDeque<QueueItem<?>>> DEQUE_MAP = new ConcurrentHashMap<>(10);
    ConcurrentHashMap<String, PriorityBlockingQueue<QueueItem<?>>> QUEUE_MAP = new ConcurrentHashMap<>(10);

    String DEQUE_SAVE_FILENAME = "save_data_deque";
    String QUEUE_SAVE_FILENAME = "save_data_queue";

    TimeUnit TIMEOUT_UNIT = TimeUnit.SECONDS;
    long POLL_TIMEOUT = 1;
}
