Interface RSetCacheAsync<V>

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

public interface RSetCacheAsync<V> extends RCollectionAsync<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
    • readAllAsync

      RFuture<Set<V>> readAllAsync()
      Read all elements at once
      Returns:
      values
    • tryAddAsync

      RFuture<Boolean> tryAddAsync(V... values)
      Tries to add elements only if none of them in set.
      Parameters:
      values - - values to add
      Returns:
      true if elements successfully added, otherwise false.
    • tryAddAsync

      RFuture<Boolean> tryAddAsync(long ttl, TimeUnit unit, V... values)
      Tries to add elements only if none of them in set.
      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.