const classredis::RedisClient

sys::Obj
  redis::RedisClient

Redis client.

append

Source

Void append(Str key, Obj val)

If key already exists and is a string, this command appends the value at the end of the string. If key does not exist it is created and set as an empty string, so append will be similar to set in this special case.

close

Source

Void close()

Close this client all connections if applicable.

del

Source

Void del(Str key)

Delete the given key value.

expire

Source

Void expire(Str key, Duration seconds)

Expire given key after given seconds has elasped, where timeout must be in even second intervals.

expireat

Source

Void expireat(Str key, DateTime timestamp)

Expire given key when the given timestamp has been reached, where timestamp has a resolution of whole seconds.

get

Source

Str? get(Str key)

Get the value for given key.

hdel

Source

Void hdel(Str key, Str field)

Delete given hash field for key.

hget

Source

Str? hget(Str key, Str field)

Get the hash field for given key.

hgetall

Source

Str:Str hgetall(Str key)

Get all hash field values for given key.

hincr

Source

Int hincr(Str key, Str field)

Convenience for hincrby(key, field 1)

hincrby

Source

Int hincrby(Str key, Str field, Int delta)

Increments the number stored at field in the hash stored at key by given delta. If the field does not exist, it is set to 0 before performing the operation.

hincrbyfloat

Source

Float hincrbyfloat(Str key, Str field, Float delta)

Increment the string representing a floating point number stored at field in the hash stored at key by the specified delta. If the key does not exist, it is set to 0 before performing the operation.

hmget

Source

Str?[] hmget(Str key, Str[] fields)

Get the hash field for given key.

hmset

Source

Void hmset(Str key, Str:Obj vals)

Set all hash values in vals for given key.

host

Source

const Str host

Host name of Redis server.

hset

Source

Void hset(Str key, Str field, Obj val)

Set the hash field to the given value for key.

incr

Source

Int incr(Str key, Duration? px := null)

Increments the number stored at key by one. If the key does not exist, it is set to 0 before performing the operation. If px is non-null expire this key after the given timeout in milliseconds. Returns the value of the key after the increment.

incrby

Source

Int incrby(Str key, Int delta, Duration? px := null)

Increments the number stored at key by delta. If the key does not exist, it is set to 0 before performing the operation. If px is non-null expire this key after the given timeout in milliseconds. Returns the value of the key after the increment.

incrbyfloat

Source

Float incrbyfloat(Str key, Float delta, Duration? px := null)

Increment the string representing a floating point number stored at key by the specified delta. If the key does not exist, it is set to 0 before performing the operation. If px is non-null expire this key after the given timeout in milliseconds. Returns the value of the key after the increment.

invoke

Source

Obj? invoke(Obj[] args)

Invoke the given command and return response.

make

Source

new make(Str host, |This? f := null)

Create a new client instance for given host and port.

maxConns

Source

const Int maxConns := 10

Max number of simultaneous connections to allow before blocking calling thread.

memStats

Source

Str:Obj memStats()

Returns information about the memory usage of server.

pexpire

Source

Void pexpire(Str key, Duration milliseconds)

Expire given key after given ms has elasped, where timeout must be in even millisecond intervals.

pipeline

Source

Obj?[] pipeline(Obj[] invokes)

Pipeline multiple invoke requests and return batched results.

port

Source

const Int port := 6379

Port number of Redis server.

sadd

Source

Void sadd(Str key, Obj member)

Add the specified member to the set stored at key, or ignore if this member already exists in this set. If key does not exist, a new set is created before adding the specified members.

saddAll

Source

Void saddAll(Str key, Obj[] members)

Add the specified members to the set stored at key. Specified members that are already a member of this set are ignored. If key does not exist, a new set is created before adding the specified members.

scard

Source

Int scard(Str key)

Returns the set cardinality (number of elements) of the set stored at key.

set

Source

Void set(Str key, Obj? val, Duration? px := null)

Set the given key to value, if val is null this method deletes the given key (see del). If px is non-null expire this key after the given timeout in milliseconds.

setnx

Source

Bool setnx(Str key, Obj val, Duration? px := null)

Set the given key to value only if key does not exist. Returns true if set was succesfull, or false if set failed due to already existing key. If px is non-null expire this key after the given timeout in milliseconds.

sismember

Source

Bool sismember(Str key, Obj member)

Returns true if member is a member of the set stored at key.

smembers

Source

Str[] smembers(Str key)

Returns all the members of the set value stored at key.

srem

Source

Void srem(Str key, Obj member)

Remove the specified member from the set stored at key, or do nothing if member does not exist in this set. If key does not exist, this method does nothing.

sremAll

Source

Void sremAll(Str key, Obj[] members)

Remove the specified member from the set stored at key. Specified members that are not a member of this set are ignored. If key does not exist, this method does nothing.