yangys
2024-05-18 c9b04383c77f91ac309e37e70783edcf8a9298b5
smart-man-boot/src/main/java/com/qianwen/smartman/common/utils/DelayList.java
@@ -11,7 +11,6 @@
import java.util.function.Consumer;
import com.qianwen.smartman.common.constant.DateConstant;
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/common/utils/DelayList.class */
public class DelayList<T> {
    private final int maxWait;
    private final int maxLen;
@@ -36,7 +35,7 @@
            return true;
        }
        if (o instanceof DelayList) {
            DelayList<?> other = (DelayList) o;
            DelayList<?> other = (DelayList<?>) o;
            if (other.canEqual(this) && getMaxWait() == other.getMaxWait() && getMaxLen() == other.getMaxLen()) {
                Object this$queue = getQueue();
                Object other$queue = other.getQueue();
@@ -105,13 +104,13 @@
    }
    public DelayList(int maxWait) {
        this.queue = new ArrayBlockingQueue(100000, true);
        this.queue = new ArrayBlockingQueue<>(100000, true);
        this.maxWait = maxWait;
        this.maxLen = 1000;
    }
    public DelayList(int maxWait, int maxLen) {
        this.queue = new ArrayBlockingQueue(100000, true);
        this.queue = new ArrayBlockingQueue<>(100000, true);
        this.maxWait = maxWait;
        this.maxLen = maxLen;
    }
@@ -125,7 +124,7 @@
        if (this.timer == null) {
            System.out.println("创建消费线程");
            this.timer = new Thread(() -> {
                ArrayList arrayList = new ArrayList();
                ArrayList<T> arrayList = new ArrayList<>();
                Queues.drainUninterruptibly(this.queue, arrayList, this.maxLen, this.maxWait, TimeUnit.SECONDS);
                if (arrayList.size() != 0) {
                    consumer.accept(arrayList);