update 整理 代码顺序

This commit is contained in:
疯狂的狮子Li 2023-08-19 22:54:42 +08:00
parent c1ed482c59
commit 2a74329206
2 changed files with 11 additions and 12 deletions

View File

@ -131,17 +131,6 @@ public class QueueUtils {
return priorityBlockingQueue.offer(data); return priorityBlockingQueue.offer(data);
} }
/**
* 尝试设置 有界队列 容量 用于限制数量
*
* @param queueName 队列名
* @param capacity 容量
*/
public static <T> boolean trySetBoundedQueueCapacity(String queueName, int capacity) {
RBoundedBlockingQueue<T> boundedBlockingQueue = CLIENT.getBoundedBlockingQueue(queueName);
return boundedBlockingQueue.trySetCapacity(capacity);
}
/** /**
* 优先队列获取一个队列数据 没有数据返回 null(不支持延迟队列) * 优先队列获取一个队列数据 没有数据返回 null(不支持延迟队列)
* *
@ -168,6 +157,17 @@ public class QueueUtils {
return queue.delete(); return queue.delete();
} }
/**
* 尝试设置 有界队列 容量 用于限制数量
*
* @param queueName 队列名
* @param capacity 容量
*/
public static <T> boolean trySetBoundedQueueCapacity(String queueName, int capacity) {
RBoundedBlockingQueue<T> boundedBlockingQueue = CLIENT.getBoundedBlockingQueue(queueName);
return boundedBlockingQueue.trySetCapacity(capacity);
}
/** /**
* 尝试设置 有界队列 容量 用于限制数量 * 尝试设置 有界队列 容量 用于限制数量
* *

View File

@ -21,7 +21,6 @@ import org.springframework.web.bind.annotation.RestController;
* @author Lion Li * @author Lion Li
* @version 3.6.0 * @version 3.6.0
*/ */
@SaIgnore
@Slf4j @Slf4j
@RequiredArgsConstructor @RequiredArgsConstructor
@RestController @RestController