Interface RBucketRx<V>

Type Parameters:
V - - the type of object
All Superinterfaces:
RExpirableRx, RObjectRx
All Known Subinterfaces:
RBinaryStreamRx, RJsonBucketRx<V>

public interface RBucketRx<V> extends RExpirableRx
Reactive implementation of object holder. Max size of object is 512MB
Author:
Nikita Koksharov
  • Method Details

    • size

      io.reactivex.rxjava3.core.Single<Long> size()
      Returns size of object in bytes
      Returns:
      object size
    • setIfAbsent

      io.reactivex.rxjava3.core.Single<Boolean> setIfAbsent(V value)
      Sets value only if object holder doesn't exist.
      Parameters:
      value - - value to set
      Returns:
      true if successful, or false if element was already set
    • setIfAbsent

      io.reactivex.rxjava3.core.Single<Boolean> setIfAbsent(V value, Duration duration)
      Sets value with defined duration only if object holder doesn't exist.
      Parameters:
      value - value to set
      duration - expiration duration
      Returns:
      true if successful, or false if element was already set
    • trySet

      @Deprecated io.reactivex.rxjava3.core.Single<Boolean> trySet(V value)
      Deprecated.
      Parameters:
      value - - value to set
      Returns:
      true if successful, or false if element was already set
    • trySet

      @Deprecated io.reactivex.rxjava3.core.Single<Boolean> trySet(V value, long timeToLive, TimeUnit timeUnit)
      Deprecated.
      Parameters:
      value - - value to set
      timeToLive - - time to live interval
      timeUnit - - unit of time to live interval
      Returns:
      true if successful, or false if element was already set
    • setIfExists

      io.reactivex.rxjava3.core.Single<Boolean> setIfExists(V value)
      Sets value only if it's already exists.
      Parameters:
      value - - value to set
      Returns:
      true if successful, or false if element wasn't set
    • setIfExists

      @Deprecated io.reactivex.rxjava3.core.Single<Boolean> setIfExists(V value, long timeToLive, TimeUnit timeUnit)
      Deprecated.
      Parameters:
      value - - value to set
      timeToLive - - time to live interval
      timeUnit - - unit of time to live interval
      Returns:
      true if successful, or false if element wasn't set
    • setIfExists

      io.reactivex.rxjava3.core.Single<Boolean> setIfExists(V value, Duration duration)
      Sets value with expiration duration only if object holder already exists.
      Parameters:
      value - value to set
      duration - expiration duration
      Returns:
      true if successful, or false if element wasn't set
    • compareAndSet

      io.reactivex.rxjava3.core.Single<Boolean> compareAndSet(V expect, V update)
      Atomically sets the value to the given updated value only if serialized state of the current value equals to serialized state of the expected value.
      Parameters:
      expect - the expected value
      update - the new value
      Returns:
      true if successful; or false if the actual value was not equal to the expected value.
    • getAndSet

      io.reactivex.rxjava3.core.Maybe<V> getAndSet(V newValue)
      Retrieves current element in the holder and replaces it with newValue.
      Parameters:
      newValue - - value to set
      Returns:
      previous value
    • getAndSet

      @Deprecated io.reactivex.rxjava3.core.Maybe<V> getAndSet(V value, long timeToLive, TimeUnit timeUnit)
      Deprecated.
      Parameters:
      value - - value to set
      timeToLive - - time to live interval
      timeUnit - - unit of time to live interval
      Returns:
      previous value
    • getAndSet

      io.reactivex.rxjava3.core.Maybe<V> getAndSet(V value, Duration duration)
      Retrieves current element in the holder and replaces it with value with defined expiration duration.
      Parameters:
      value - value to set
      duration - expiration duration
      Returns:
      previous value
    • getAndExpire

      io.reactivex.rxjava3.core.Maybe<V> getAndExpire(Duration duration)
      Retrieves current element in the holder and sets an expiration duration for it.

      Requires Redis 6.2.0 and higher.

      Parameters:
      duration - of object time to live interval
      Returns:
      element
    • getAndExpire

      io.reactivex.rxjava3.core.Maybe<V> getAndExpire(Instant time)
      Retrieves current element in the holder and sets an expiration date for it.

      Requires Redis 6.2.0 and higher.

      Parameters:
      time - of exact object expiration moment
      Returns:
      element
    • getAndClearExpire

      io.reactivex.rxjava3.core.Maybe<V> getAndClearExpire()
      Retrieves current element in the holder and clears expiration date set before.

      Requires Redis 6.2.0 and higher.

      Returns:
      element
    • get

      io.reactivex.rxjava3.core.Maybe<V> get()
      Retrieves element stored in the holder.
      Returns:
      element
    • getAndDelete

      io.reactivex.rxjava3.core.Maybe<V> getAndDelete()
      Retrieves element in the holder and removes it.
      Returns:
      element
    • set

      io.reactivex.rxjava3.core.Completable set(V value)
      Stores element into the holder.
      Parameters:
      value - - value to set
      Returns:
      void
    • set

      @Deprecated io.reactivex.rxjava3.core.Completable set(V value, long timeToLive, TimeUnit timeUnit)
      Deprecated.
      Parameters:
      value - - value to set
      timeToLive - - time to live interval
      timeUnit - - unit of time to live interval
      Returns:
      void
    • set

      io.reactivex.rxjava3.core.Completable set(V value, Duration duration)
      Stores value into the holder with defined expiration duration.
      Parameters:
      value - value to set
      duration - expiration duration
    • setAndKeepTTL

      io.reactivex.rxjava3.core.Completable setAndKeepTTL(V value)
      Set value and keep existing TTL.

      Requires Redis 6.0.0 and higher.

      Parameters:
      value - - value to set
      Returns:
      void