Package org.redisson.api
Interface RIdGeneratorRx
-
- All Superinterfaces:
RExpirableRx
,RObjectRx
public interface RIdGeneratorRx extends RExpirableRx
Id generator ofLong
type numbers. Returns unique numbers but not monotonically increased.- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description io.reactivex.rxjava3.core.Single<Long>
nextId()
Returns next unique number but not monotonically increasedio.reactivex.rxjava3.core.Single<Boolean>
tryInit(long value, long allocationSize)
Initializes Id generator params.-
Methods inherited from interface org.redisson.api.RExpirableRx
clearExpire, expire, expireAt, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RObjectRx
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
-
-
-
Method Detail
-
tryInit
io.reactivex.rxjava3.core.Single<Boolean> tryInit(long value, long allocationSize)
Initializes Id generator params.- Parameters:
value
- - initial valueallocationSize
- - values range allocation size- Returns:
true
if Id generator initializedfalse
if Id generator already initialized
-
nextId
io.reactivex.rxjava3.core.Single<Long> nextId()
Returns next unique number but not monotonically increased- Returns:
- number
-
-