classredis::RedisBatch
sys::Obj redis::RedisBatch
RedisBatch builds a list of commands that can be run in batch using pipeline or multi.
- del
Delete the given key value.
- expire
This expire(Str key, Duration seconds)Expire given key after given
secondshas elasped, where timeout must be in even second intervals.- expireat
This expireat(Str key, DateTime timestamp)Expire given key when the given
timestamphas been reached, wheretimestamphas a resolution of whole seconds.- get
Get the value for given key.
- incr
Increments the number stored at key by one. If the key does not exist, it is set to 0 before performing the operation. If
pxis non-null expire this key after the given timeout in milliseconds. Returns the value of the key after the increment.- incrby
This incrby(Str key, Int delta)Increments the number stored at key by
delta. If the key does not exist, it is set to 0 before performing the operation. Ifpxis non-null expire this key after the given timeout in milliseconds. Returns the value of the key after the increment.- incrbyfloat
This incrbyfloat(Str key, Float delta)Increment the string representing a floating point number stored at
keyby the specifieddelta. If the key does not exist, it is set to 0 before performing the operation. Ifpxis non-null expire this key after the given timeout in milliseconds. Returns the value of the key after the increment.- pexpire
This pexpire(Str key, Duration milliseconds)Expire given key after given
mshas elasped, where timeout must be in even millisecond intervals.- set
This set(Str key, Obj? val, Duration? px := null)Set the given key to value, if
valis null this method deletes the given key (see del). Ifpxis non-null expire this key after the given timeout in milliseconds.- setnx
This setnx(Str key, Obj val, Duration? px := null)Set the given key to value only if key does not exist. Returns
trueif set was succesfull, or false if set failed due to already existing key. Ifpxis non-null expire this key after the given timeout in milliseconds.- size
Int size()Return number of commands in this batch.