Add RSetReactive.random

pull/546/head
Dan Checkoway 9 years ago
parent 79c4141794
commit 82da3f6ef6

@ -36,6 +36,14 @@ public interface RSetReactive<V> extends RCollectionReactive<V> {
*/ */
Publisher<V> removeRandom(); Publisher<V> removeRandom();
/**
* Returns random element from set
* in async mode
*
* @return
*/
Publisher<V> random();
/** /**
* Move a member from this set to the given destination set in async mode. * Move a member from this set to the given destination set in async mode.
* *

@ -80,6 +80,11 @@ public class RedissonSetReactive<V> extends RedissonExpirableReactive implements
return reactive(instance.removeRandomAsync()); return reactive(instance.removeRandomAsync());
} }
@Override
public Publisher<V> random() {
return reactive(instance.randomAsync());
}
@Override @Override
public Publisher<Boolean> remove(Object o) { public Publisher<Boolean> remove(Object o) {
return reactive(instance.removeAsync(o)); return reactive(instance.removeAsync(o));

Loading…
Cancel
Save