Interface RSetCacheAsync<V>

Type Parameters:
V - value
All Superinterfaces:
RCollectionAsync<V>, RExpirableAsync, RObjectAsync, RSetAsync<V>, RSortableAsync<Set<V>>
All Known Subinterfaces:
RSetCache<V>
All Known Implementing Classes:
RedissonSetCache, RedissonTransactionalSetCache

public interface RSetCacheAsync<V> extends RSetAsync<V>
Async set functions
Author:
Nikita Koksharov
  • Method Details

    • addAsync

      RFuture<Boolean> addAsync(V value, long ttl, TimeUnit unit)
      Stores value with specified time to live. Value expires after specified time to live.
      Parameters:
      value - to add
      ttl - - time to live for key\value entry. If 0 then stores infinitely.
      unit - - time unit
      Returns:
      true if value has been added. false if value already been in collection.
    • sizeAsync

      RFuture<Integer> sizeAsync()
      Returns the number of elements in cache. This number can reflects expired elements too due to non realtime cleanup process.
      Specified by:
      sizeAsync in interface RCollectionAsync<V>
      Returns:
      size of set
    • tryAddAsync

      @Deprecated RFuture<Boolean> tryAddAsync(long ttl, TimeUnit unit, V... values)
      Deprecated.
      Parameters:
      values - - values to add
      ttl - - time to live for value. If 0 then stores infinitely.
      unit - - time unit
      Returns:
      true if elements successfully added, otherwise false.
    • addIfAbsentAsync

      RFuture<Boolean> addIfAbsentAsync(Duration ttl, V object)
      Adds element to this set only if has not been added before.

      Requires Redis 3.0.2 and higher.

      Parameters:
      ttl - - object ttl
      object - - object itself
      Returns:
      true if element added and false if not.
    • addIfExistsAsync

      RFuture<Boolean> addIfExistsAsync(Duration ttl, V object)
      Adds element to this set only if it's already exists.

      Requires Redis 3.0.2 and higher.

      Parameters:
      ttl - - object ttl
      object - - object itself
      Returns:
      true if element added and false if not.
    • addIfLessAsync

      RFuture<Boolean> addIfLessAsync(Duration ttl, V object)
      Adds element to this set only if new ttl less than current ttl of existed element.

      Requires Redis 6.2.0 and higher.

      Parameters:
      ttl - - object ttl
      object - - object itself
      Returns:
      true if element added and false if not.
    • addIfGreaterAsync

      RFuture<Boolean> addIfGreaterAsync(Duration ttl, V object)
      Adds element to this set only if new ttl greater than current ttl of existed element.

      Requires Redis 6.2.0 and higher.

      Parameters:
      ttl - - object ttl
      object - - object itself
      Returns:
      true if element added and false if not.
    • addAllAsync

      RFuture<Integer> addAllAsync(Map<V,Duration> objects)
      Adds all elements contained in the specified map to this sorted set. Map contains of ttl mapped by object.
      Parameters:
      objects - - map of elements to add
      Returns:
      amount of added elements, not including already existing in this sorted set
    • addAllIfAbsentAsync

      RFuture<Integer> addAllIfAbsentAsync(Map<V,Duration> objects)
      Adds elements to this set only if they haven't been added before.

      Requires Redis 3.0.2 and higher.

      Parameters:
      objects - map of elements to add
      Returns:
      amount of added elements
    • addAllIfExistAsync

      RFuture<Integer> addAllIfExistAsync(Map<V,Duration> objects)
      Adds elements to this set only if they already exist.

      Requires Redis 3.0.2 and higher.

      Parameters:
      objects - map of elements to add
      Returns:
      amount of added elements
    • addAllIfGreaterAsync

      RFuture<Integer> addAllIfGreaterAsync(Map<V,Duration> objects)
      Adds elements to this set only if new ttl greater than current ttl of existed elements.

      Requires Redis 6.2.0 and higher.

      Parameters:
      objects - map of elements to add
      Returns:
      amount of added elements
    • addAllIfLessAsync

      RFuture<Integer> addAllIfLessAsync(Map<V,Duration> objects)
      Adds elements to this set only if new ttl less than current ttl of existed elements.

      Requires Redis 6.2.0 and higher.

      Parameters:
      objects - map of elements to add
      Returns:
      amount of added elements