mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 12:12:08 +08:00
enhancement #I49JP1 DataBus中SlotSize的大小不支持动态扩展,无法应对高并发下的流量突增
This commit is contained in:
@@ -52,6 +52,10 @@ public class DataBus {
|
||||
public static int offerSlot(Class<? extends Slot> slotClazz) {
|
||||
try {
|
||||
Slot slot = slotClazz.newInstance();
|
||||
|
||||
//这里有没有并发问题?
|
||||
//没有,因为QUEUE的类型为ConcurrentLinkedQueue,并发情况下,每次取到的index不会相同
|
||||
//当然前提是QUEUE里面的值不会重复,但是这个是由其他机制来保证的
|
||||
Integer slotIndex = QUEUE.poll();
|
||||
|
||||
if (ObjectUtil.isNull(slotIndex)){
|
||||
|
||||
Reference in New Issue
Block a user