DelayQueue 是一个有界队列。虽然它是基于 PriorityBlockingQueue 实现的,PriorityBlockingQueue 是一个无界队列,但是 DelayQueue 在 PriorityBlockingQueue 的基础上增加了延迟元素的特性,即只有在延迟时间到达之后才能从队列中取出元素,因此 DelayQueue 是有界的。

DelayQueue 是无界队列吗?深入解析 DelayQueue 的边界特性

原文地址: https://www.cveoy.top/t/topic/jU5g 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录