The first version is pretty simple, just keep track when a value would
expire and check that value before returning any value (in db.rs, mainly
in get and getset methods and any reading operation).
The second version would spawn a worker that would run every few seconds
to remove expired keys and release some memory.
The first version is enough to be compatible with redis promised
behaviour of "removing" expired keys.
The first version is pretty simple, just keep track when a value would expire and check that value before returning any value (in db.rs, mainly in
get
andgetset
methods and any reading operation).The second version would spawn a worker that would run every few seconds to remove expired keys and release some memory.
The first version is enough to be compatible with redis promised behaviour of "removing" expired keys.