package com.fs.fastgptApi.util;

import com.fs.fastGpt.domain.FastGptEventLog;
import com.fs.fastGpt.domain.FastGptEventTokenLog;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

public class EventLogQueue {
    private static final BlockingQueue<FastGptEventLog> eventLogQueue = new LinkedBlockingQueue<>(10000);
    private static final BlockingQueue<FastGptEventTokenLog> eventTokenLogQueue = new LinkedBlockingQueue<>(10000);

    public static void addEventLog(FastGptEventLog log) {
        eventLogQueue.offer(log);
    }

    public static void addEventTokenLog(FastGptEventTokenLog log) {
        eventTokenLogQueue.offer(log);
    }

    public static FastGptEventLog pollEventLog() {
        return eventLogQueue.poll();
    }

    public static FastGptEventTokenLog pollEventTokenLog() {
        return eventTokenLogQueue.poll();
    }
}