change return type

Signed-off-by: Abhishek Chandrasekaran <abchandrasekar@expediagroup.com>
pull/3003/head
Abhishek Chandrasekaran 5 years ago
parent 57aed018b3
commit cc13effd64

@ -244,13 +244,13 @@ public class RedissonRateLimiter extends RedissonExpirable implements RRateLimit
}
@Override
public boolean setRate(RateType type, long rate, long rateInterval, RateIntervalUnit unit) {
return get(setRateAsync(type, rate, rateInterval, unit));
public void setRate(RateType type, long rate, long rateInterval, RateIntervalUnit unit) {
setRateAsync(type, rate, rateInterval, unit);
}
@Override
public RFuture<Boolean> setRateAsync(RateType type, long rate, long rateInterval, RateIntervalUnit unit) {
return commandExecutor.evalWriteAsync(getName(), LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN,
public RFuture<Void> setRateAsync(RateType type, long rate, long rateInterval, RateIntervalUnit unit) {
return commandExecutor.evalWriteAsync(getName(), LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN,
"redis.call('hset', KEYS[1], 'rate', ARGV[1]);"
+ "redis.call('hset', KEYS[1], 'interval', ARGV[2]);"
+ "redis.call('hset', KEYS[1], 'type', ARGV[3]);"

@ -44,10 +44,8 @@ public interface RRateLimiter extends RRateLimiterAsync, RExpirable {
* @param rate - rate
* @param rateInterval - rate time interval
* @param rateIntervalUnit - rate time interval unit
* @return {@code true} if rate was set and {@code false}
* otherwise
*/
boolean setRate(RateType mode, long rate, long rateInterval, RateIntervalUnit rateIntervalUnit);
void setRate(RateType mode, long rate, long rateInterval, RateIntervalUnit rateIntervalUnit);
/**
* Acquires a permit only if one is available at the

@ -155,7 +155,7 @@ public interface RRateLimiterAsync extends RExpirableAsync {
* @return {@code true} if rate was set and {@code false}
* otherwise
*/
RFuture<Boolean> setRateAsync(RateType mode, long rate, long rateInterval, RateIntervalUnit rateIntervalUnit);
RFuture<Void> setRateAsync(RateType mode, long rate, long rateInterval, RateIntervalUnit rateIntervalUnit);
/**
* Returns current configuration of this RateLimiter object.

Loading…
Cancel
Save