Interface RIdGeneratorRx

All Superinterfaces:
RExpirableRx, RObjectRx

public interface RIdGeneratorRx extends RExpirableRx
Id generator of Long type numbers. Returns unique numbers but not monotonically increased.
Author:
Nikita Koksharov
  • Method Details

    • tryInit

      io.reactivex.rxjava3.core.Single<Boolean> tryInit(long value, long allocationSize)
      Initializes Id generator params.
      Parameters:
      value - - initial value
      allocationSize - - values range allocation size
      Returns:
      true if Id generator initialized false if Id generator already initialized
    • nextId

      io.reactivex.rxjava3.core.Single<Long> nextId()
      Returns next unique number but not monotonically increased
      Returns:
      number