$keys Full keys. * @return array */ public function getMany( array $keys ): array; /** * Writes a value. * * @param string $key Full key. * @param mixed $value Value. * @param int $ttl Seconds. */ public function set( string $key, mixed $value, int $ttl ): bool; /** * Writes several values in one round trip. * * @param array $values Values by full key. * @param int $ttl Seconds. */ public function setMany( array $values, int $ttl ): void; /** * Writes only if the key does not exist. * * @param string $key Full key. * @param mixed $value Value. * @param int $ttl Seconds. */ public function add( string $key, mixed $value, int $ttl ): bool; /** * Writes only if the key exists. * * @param string $key Full key. * @param mixed $value Value. * @param int $ttl Seconds. */ public function replace( string $key, mixed $value, int $ttl ): bool; /** * Deletes a key. * * @param string $key Full key. * @return bool Whether it existed. */ public function delete( string $key ): bool; /** * Deletes several keys. * * @param list $keys Full keys. */ public function deleteMany( array $keys ): void; /** * Adds to a numeric value. * * @param string $key Full key. * @param int $by Delta (may be negative). * @return int|null New value, or null when the key does not exist. */ public function increment( string $key, int $by ): ?int; /** * Deletes every key starting with a prefix, without blocking the server. * * @param string $prefix Literal prefix. * @return int Number of keys deleted. */ public function deleteByPrefix( string $prefix ): int; /** * Adds counters to a metrics hash. * * @param string $key Full key. * @param array $fields Increments. * @param int $ttl Seconds. */ public function recordMetrics( string $key, array $fields, int $ttl ): void; /** * Reads metrics hashes. * * @param list $keys Full keys. * @return array> */ public function readMetrics( array $keys ): array; /** * Server information (version, memory). * * @return array */ public function info(): array; }