Fixed according to comments

Signed-off-by: Vorotyntsev <vorotyntsevdanila@gmail.com>
pull/3364/head
Vorotyntsev 4 years ago
parent 5b2a91fb1f
commit 996a545ece

@ -127,6 +127,17 @@ public class RedissonReactive implements RedissonReactiveClient {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonLock(commandExecutor, name), RLockReactive.class); return ReactiveProxyBuilder.create(commandExecutor, new RedissonLock(commandExecutor, name), RLockReactive.class);
} }
@Override
public RLockReactive getSpinLock(String name) {
return getSpinLock(name, RedissonSpinLock.DEFAULT);
}
@Override
public RLockReactive getSpinLock(String name, RedissonSpinLock.BackOffOptions backOffOptions) {
RedissonSpinLock spinLock = new RedissonSpinLock(commandExecutor, name, backOffOptions);
return ReactiveProxyBuilder.create(commandExecutor, spinLock, RLockReactive.class);
}
@Override @Override
public RLockReactive getMultiLock(RLock... locks) { public RLockReactive getMultiLock(RLock... locks) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonMultiLock(locks), RLockReactive.class); return ReactiveProxyBuilder.create(commandExecutor, new RedissonMultiLock(locks), RLockReactive.class);

@ -114,6 +114,17 @@ public class RedissonRx implements RedissonRxClient {
public RLockRx getLock(String name) { public RLockRx getLock(String name) {
return RxProxyBuilder.create(commandExecutor, new RedissonLock(commandExecutor, name), RLockRx.class); return RxProxyBuilder.create(commandExecutor, new RedissonLock(commandExecutor, name), RLockRx.class);
} }
@Override
public RLockRx getSpinLock(String name) {
return getSpinLock(name, RedissonSpinLock.DEFAULT);
}
@Override
public RLockRx getSpinLock(String name, RedissonSpinLock.BackOffOptions backOffOptions) {
RedissonSpinLock spinLock = new RedissonSpinLock(commandExecutor, name, backOffOptions);
return RxProxyBuilder.create(commandExecutor, spinLock, RLockRx.class);
}
@Override @Override
public RLockRx getMultiLock(RLock... locks) { public RLockRx getMultiLock(RLock... locks) {

@ -15,6 +15,7 @@
*/ */
package org.redisson.api; package org.redisson.api;
import org.redisson.RedissonSpinLock;
import org.redisson.client.codec.Codec; import org.redisson.client.codec.Codec;
import org.redisson.config.Config; import org.redisson.config.Config;
@ -164,6 +165,30 @@ public interface RedissonReactiveClient {
* @return Lock object * @return Lock object
*/ */
RLockReactive getLock(String name); RLockReactive getLock(String name);
/**
* Returns Spin lock instance by name.
* <p>
* Implements a <b>non-fair</b> locking so doesn't guarantees an acquire order by threads.
* <p>
* Lock doesn't use a pub/sub mechanism
*
* @param name - name of object
* @return Lock object
*/
RLockReactive getSpinLock(String name);
/**
* Returns Spin lock instance by name with specified back off options.
* <p>
* Implements a <b>non-fair</b> locking so doesn't guarantees an acquire order by threads.
* <p>
* Lock doesn't use a pub/sub mechanism
*
* @param name - name of object
* @return Lock object
*/
RLockReactive getSpinLock(String name, RedissonSpinLock.BackOffOptions backOffOptions);
/** /**
* Returns MultiLock instance associated with specified <code>locks</code> * Returns MultiLock instance associated with specified <code>locks</code>

@ -15,6 +15,7 @@
*/ */
package org.redisson.api; package org.redisson.api;
import org.redisson.RedissonSpinLock;
import org.redisson.client.codec.Codec; import org.redisson.client.codec.Codec;
import org.redisson.config.Config; import org.redisson.config.Config;
@ -163,6 +164,30 @@ public interface RedissonRxClient {
* @return Lock object * @return Lock object
*/ */
RLockRx getLock(String name); RLockRx getLock(String name);
/**
* Returns Spin lock instance by name.
* <p>
* Implements a <b>non-fair</b> locking so doesn't guarantees an acquire order by threads.
* <p>
* Lock doesn't use a pub/sub mechanism
*
* @param name - name of object
* @return Lock object
*/
RLockRx getSpinLock(String name);
/**
* Returns Spin lock instance by name with specified back off options.
* <p>
* Implements a <b>non-fair</b> locking so doesn't guarantees an acquire order by threads.
* <p>
* Lock doesn't use a pub/sub mechanism
*
* @param name - name of object
* @return Lock object
*/
RLockRx getSpinLock(String name, RedissonSpinLock.BackOffOptions backOffOptions);
/** /**
* Returns MultiLock instance associated with specified <code>locks</code> * Returns MultiLock instance associated with specified <code>locks</code>

Loading…
Cancel
Save