提交 01b94a82 编写于 作者: N Nikita Koksharov

refactoring

上级 b10e8c55
......@@ -53,10 +53,7 @@ public class RedissonBoundedBlockingQueue<V> extends RedissonQueue<V> implements
}
private String getSemaphoreName() {
if (getName().contains("{")) {
return "redisson_bqs:" + getName();
}
return "redisson_bqs:{" + getName() + "}";
return prefixName("redisson_bqs", getName());
}
@Override
......@@ -310,6 +307,7 @@ public class RedissonBoundedBlockingQueue<V> extends RedissonQueue<V> implements
Arrays.<Object>asList(getName(), getSemaphoreName(), channelName), maxElements);
}
@Override
public RFuture<Boolean> trySetCapacityAsync(int capacity) {
String channelName = RedissonSemaphore.getChannelName(getSemaphoreName());
return commandExecutor.evalWriteAsync(getName(), LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN,
......@@ -323,6 +321,7 @@ public class RedissonBoundedBlockingQueue<V> extends RedissonQueue<V> implements
Arrays.<Object>asList(getSemaphoreName(), channelName), capacity);
}
@Override
public boolean trySetCapacity(int capacity) {
return get(trySetCapacityAsync(capacity));
}
......
......@@ -16,7 +16,7 @@
package org.redisson.api;
/**
* This RingBuffer based queue evicts elements from the head if queue capacity became full.
* RingBuffer based queue evicts elements from the head if queue capacity became full.
* <p>
* The head element removed if new element added and queue is full.
* <p>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册