Package org.miaixz.bus.core.center.queue
package org.miaixz.bus.core.center.queue
队列
Queue相关封装- Since:
- Java 17+
- Author:
- Kimi Liu
-
ClassDescription有界优先队列 按照给定的排序规则,排序元素,当队列满时,按照给定的排序规则淘汰末尾元素(去除末尾元素)自定义加入前检查的
LinkedBlockingQueue,给定一个检查函数,在加入元素前检查此函数 原理是通过Runtime#freeMemory()获取剩余内存,当剩余内存低于指定的阈值时,不再加入。始终为空的队列,所有新增节点都丢弃An element that is linked on theDeque.LinkedDeque<E extends Linked<E>>Linked list implementation of theDequeinterface where the link pointers are tightly integrated with the element.内存安全的LinkedBlockingQueue,可以解决OOM问题。 原理是通过Runtime#freeMemory()获取剩余内存,当剩余内存低于指定的阈值时,不再加入。