crodas / microredis

Redis server implemented in rust.
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Added first version key expirations. #1

Closed crodas closed 2 years ago

crodas commented 2 years ago

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.