Table
class Table (View source)
Relay Table is a persistent hash table shared across workers that can store arbitrary data.
Methods
Returns a key's value, or null if key doesn't exist.
Get the value and metadata of key.
Sets a key and its value.
Checks if a key exists in the table.
Remove a key from the table.
Returns the remaining time to live of a key that has a timeout,
or false if the key doesn't exist or has no timeout.
Returns the number of keys stored in the table.
Removes all keys from the table.
Returns all keys matching pattern.
Returns the number of bytes allocated for all elements.
Returns all table namespaces.
Removes all keys from all namespaces.
Scan the keyspace for matching keys on each namespace.
Returns statistics about Table.
Details
static mixed
get(string $key, string|null $namespace = null)
Returns a key's value, or null if key doesn't exist.
static array|false
getWithMeta(mixed $key, string|null $namespace = null)
Get the value and metadata of key.
static bool
set(string $key, mixed $value, int|null $expire = null, string|null $namespace = null)
Sets a key and its value.
static bool
exists(string $key, string|null $namespace = null)
Checks if a key exists in the table.
static bool
delete(string $key, string|null $namespace = null)
Remove a key from the table.
static int|false
ttl(string $key, string|null $namespace = null)
Returns the remaining time to live of a key that has a timeout,
or false if the key doesn't exist or has no timeout.
static int|false
count(string|null $namespace = null)
Returns the number of keys stored in the table.
static bool
clear(string|null $namespace = null)
Removes all keys from the table.
static array|false
keys(mixed $pattern, string|null $namespace = null)
Returns all keys matching pattern.
static int|false
memory(string|null $namespace = null)
Returns the number of bytes allocated for all elements.
static array|false
namespaces()
Returns all table namespaces.
static int|false
clearAll()
Removes all keys from all namespaces.
static Generator|false
fullscan(mixed $match = null, int $count = 0)
Scan the keyspace for matching keys on each namespace.
static array|false
stats()
Returns statistics about Table.