Interface RSetCacheRx<V>

Type Parameters:
V - value
All Superinterfaces:
RCollectionRx<V>, RDestroyable, RExpirableRx, RObjectRx

public interface RSetCacheRx<V> extends RCollectionRx<V>, RDestroyable
RxJava2 interface for RSetCache object
Author:
Nikita Koksharov
  • Method Details

    • getPermitExpirableSemaphore

      RPermitExpirableSemaphoreRx getPermitExpirableSemaphore(V value)
      Returns RPermitExpirableSemaphore instance associated with value
      Parameters:
      value - - set value
      Returns:
      RPermitExpirableSemaphore object
    • getSemaphore

      RSemaphoreRx getSemaphore(V value)
      Returns RSemaphore instance associated with value
      Parameters:
      value - - set value
      Returns:
      RSemaphore object
    • getFairLock

      RLockRx getFairLock(V value)
      Returns RLock instance associated with value
      Parameters:
      value - - set value
      Returns:
      RLock object
    • getReadWriteLock

      RReadWriteLockRx getReadWriteLock(V value)
      Returns RReadWriteLock instance associated with value
      Parameters:
      value - - set value
      Returns:
      RReadWriteLock object
    • getLock

      RLockRx getLock(V value)
      Returns lock instance associated with value
      Parameters:
      value - - set value
      Returns:
      RLock object
    • add

      io.reactivex.rxjava3.core.Single<Boolean> add(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.
    • size

      io.reactivex.rxjava3.core.Single<Integer> size()
      Returns the number of elements in cache. This number can reflects expired elements too due to non realtime cleanup process.
      Specified by:
      size in interface RCollectionRx<V>
      Returns:
      size of collection
    • readAll

      io.reactivex.rxjava3.core.Single<Set<V>> readAll()
      Read all elements at once
      Returns:
      values
    • tryAdd

      io.reactivex.rxjava3.core.Single<Boolean> tryAdd(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.
    • tryAdd

      io.reactivex.rxjava3.core.Single<Boolean> tryAdd(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.