refactoring

pull/1821/head
Nikita Koksharov 6 years ago
parent 4abd81e49f
commit 6226feb1f2

@ -422,13 +422,13 @@ public interface RScoredSortedSetReactive<V> extends RExpirableReactive, RSortab
* *
* @return the head element * @return the head element
*/ */
Publisher<V> takeFirst(); Mono<V> takeFirst();
/** /**
* Removes and returns the tail element waiting if necessary for an element to become available. * Removes and returns the tail element waiting if necessary for an element to become available.
* *
* @return the tail element * @return the tail element
*/ */
Publisher<V> takeLast(); Mono<V> takeLast();
} }

@ -51,7 +51,7 @@ public class RedissonScoredSortedSetReactive<V> {
this.instance = instance; this.instance = instance;
} }
private Publisher<V> scanIteratorReactive(final String pattern, final int count) { private Flux<V> scanIteratorReactive(final String pattern, final int count) {
return Flux.create(new SetReactiveIterator<V>() { return Flux.create(new SetReactiveIterator<V>() {
@Override @Override
protected RFuture<ListScanResult<Object>> scanIterator(final RedisClient client, final long nextIterPos) { protected RFuture<ListScanResult<Object>> scanIterator(final RedisClient client, final long nextIterPos) {
@ -64,20 +64,20 @@ public class RedissonScoredSortedSetReactive<V> {
return ((RedissonScoredSortedSet<V>)instance).getName(); return ((RedissonScoredSortedSet<V>)instance).getName();
} }
public Publisher<V> iterator() { public Flux<V> iterator() {
return scanIteratorReactive(null, 10); return scanIteratorReactive(null, 10);
} }
public Publisher<V> iterator(String pattern) { public Flux<V> iterator(String pattern) {
return scanIteratorReactive(pattern, 10); return scanIteratorReactive(pattern, 10);
} }
public Publisher<V> iterator(int count) { public Flux<V> iterator(int count) {
return scanIteratorReactive(null, count); return scanIteratorReactive(null, count);
} }
public Publisher<V> iterator(String pattern, int count) { public Flux<V> iterator(String pattern, int count) {
return scanIteratorReactive(pattern, count); return scanIteratorReactive(pattern, count);
} }
} }

Loading…
Cancel
Save