Package org.redisson.api
Interface RSetReactive<V>
-
- Type Parameters:
V
- value
- All Superinterfaces:
RCollectionReactive<V>
,RExpirableReactive
,RObjectReactive
,RSortableReactive<Set<V>>
public interface RSetReactive<V> extends RCollectionReactive<V>, RSortableReactive<Set<V>>
Async set functions- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.reactivestreams.Publisher<Long>
diff(String... names)
Diff sets specified by name and write to current set.org.reactivestreams.Publisher<Long>
intersection(String... names)
Intersection sets specified by name and write to current set.org.reactivestreams.Publisher<V>
iterator(int count)
Returns an iterator over elements in this set.org.reactivestreams.Publisher<V>
iterator(String pattern)
Returns iterator over elements in this set matchespattern
.org.reactivestreams.Publisher<V>
iterator(String pattern, int count)
Returns an iterator over elements in this set.org.reactivestreams.Publisher<Boolean>
move(String destination, V member)
Move a member from this set to the given destination set in async mode.org.reactivestreams.Publisher<V>
random()
Returns random element from set in async modeorg.reactivestreams.Publisher<Set<V>>
readAll()
Read all elements at onceorg.reactivestreams.Publisher<Set<V>>
readDiff(String... names)
Diff sets specified by name with current set.org.reactivestreams.Publisher<Set<V>>
readIntersection(String... names)
Intersection sets specified by name with current set.org.reactivestreams.Publisher<Set<V>>
readUnion(String... names)
Union sets specified by name with current set.org.reactivestreams.Publisher<V>
removeRandom()
Removes and returns random element from set in async modeorg.reactivestreams.Publisher<Set<V>>
removeRandom(int amount)
Removes and returns random elements from set in async modeorg.reactivestreams.Publisher<Long>
union(String... names)
Union sets specified by name and write to current set.-
Methods inherited from interface org.redisson.api.RCollectionReactive
add, addAll, addAll, contains, containsAll, iterator, remove, removeAll, retainAll, size
-
Methods inherited from interface org.redisson.api.RExpirableReactive
clearExpire, expire, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RObjectReactive
copy, delete, dump, getCodec, getName, isExists, migrate, move, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, touch, unlink
-
Methods inherited from interface org.redisson.api.RSortableReactive
readSorted, readSorted, readSorted, readSorted, readSorted, readSorted, sortTo, sortTo, sortTo, sortTo, sortTo, sortTo
-
-
-
-
Method Detail
-
iterator
org.reactivestreams.Publisher<V> iterator(int count)
Returns an iterator over elements in this set. Elements are loaded in batch. Batch size is defined bycount
param.- Parameters:
count
- - size of elements batch- Returns:
- iterator
-
iterator
org.reactivestreams.Publisher<V> iterator(String pattern, int count)
Returns an iterator over elements in this set. Elements are loaded in batch. Batch size is defined bycount
param. If pattern is not null then only elements match this pattern are loaded.- Parameters:
pattern
- - search patterncount
- - size of elements batch- Returns:
- iterator
-
iterator
org.reactivestreams.Publisher<V> iterator(String pattern)
Returns iterator over elements in this set matchespattern
.- Parameters:
pattern
- - search pattern- Returns:
- iterator
-
removeRandom
org.reactivestreams.Publisher<Set<V>> removeRandom(int amount)
Removes and returns random elements from set in async mode- Parameters:
amount
- of random values- Returns:
- random values
-
removeRandom
org.reactivestreams.Publisher<V> removeRandom()
Removes and returns random element from set in async mode- Returns:
- value
-
random
org.reactivestreams.Publisher<V> random()
Returns random element from set in async mode- Returns:
- value
-
move
org.reactivestreams.Publisher<Boolean> move(String destination, V member)
Move a member from this set to the given destination set in async mode.- Parameters:
destination
- the destination setmember
- the member to move- Returns:
- true if the element is moved, false if the element is not a member of this set or no operation was performed
-
union
org.reactivestreams.Publisher<Long> union(String... names)
Union sets specified by name and write to current set. If current set already exists, it is overwritten.- Parameters:
names
- - name of sets- Returns:
- size of union
-
readUnion
org.reactivestreams.Publisher<Set<V>> readUnion(String... names)
Union sets specified by name with current set. Without current set state change.- Parameters:
names
- - name of sets- Returns:
- size of union
-
diff
org.reactivestreams.Publisher<Long> diff(String... names)
Diff sets specified by name and write to current set. If current set already exists, it is overwritten.- Parameters:
names
- - name of sets- Returns:
- size of diff
-
readDiff
org.reactivestreams.Publisher<Set<V>> readDiff(String... names)
Diff sets specified by name with current set. Without current set state change.- Parameters:
names
- - name of sets- Returns:
- values
-
intersection
org.reactivestreams.Publisher<Long> intersection(String... names)
Intersection sets specified by name and write to current set. If current set already exists, it is overwritten.- Parameters:
names
- - name of sets- Returns:
- size of intersection
-
-