Interface RBucketRx<V>

  • Type Parameters:
    V - - the type of object
    All Superinterfaces:
    RExpirableRx, RObjectRx

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

      • size

        io.reactivex.Flowable<Long> size()
        Returns size of object in bytes
        Returns:
        object size
      • trySet

        io.reactivex.Flowable<Boolean> trySet​(V value)
        Tries to set element atomically into empty holder.
        Parameters:
        value - - value to set
        Returns:
        true if successful, or false if element was already set
      • trySet

        io.reactivex.Flowable<Boolean> trySet​(V value,
                                              long timeToLive,
                                              TimeUnit timeUnit)
        Tries to set element atomically into empty holder with defined timeToLive interval.
        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
      • compareAndSet

        io.reactivex.Flowable<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.Flowable<V> getAndSet​(V newValue)
        Retrieves current element in the holder and replaces it with newValue.
        Parameters:
        newValue - - value to set
        Returns:
        previous value
      • get

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

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

        io.reactivex.Flowable<Void> set​(V value)
        Stores element into the holder.
        Parameters:
        value - - value to set
        Returns:
        void
      • set

        io.reactivex.Flowable<Void> set​(V value,
                                        long timeToLive,
                                        TimeUnit timeUnit)
        Stores element into the holder with defined timeToLive interval.
        Parameters:
        value - - value to set
        timeToLive - - time to live interval
        timeUnit - - unit of time to live interval
        Returns:
        void