The perpose of this module is to simplify, improve and extend the expiration mechanism of redis elements for real-time applications.
> SET hello world
OK
> REXPIRE hello 10000
(integer) 0
> GET hello
"world"
...
// Wait 9.99.. seconds
> GET hello
"world"
...
// And then..
> GET hello
(nil)
The API follows the vanilla Redis expiration API, denoting Real-Time with R as the prefix.
This module includes the following commands (See full documentation here):
REXPIRE {key} {ttl_ms}
- Set TTL for a given keyREXPIREAT {key} {timestamp_ms}
- Set specific expiration date-time for a given keyRTTL {key}
- See the remeining time (in millisecons) until the key is auto expiredRUNEXPIRE {key}
- Remove auto expiration from the given keyRSETEX {key} {value} {ttl_ms}
- Set key to a given value and mark it for auto expiration.REXECEX {cmd} {key} {ttl_ms} {....}
- Runcmd
, set key to contain the result, and mark that key for auto expiration.
The module commands provide no guarantees of duplication with normal expiration mechanisms.
Apache 2.0 with Commons Clause - see LICENSE