Closed dyorgio closed 8 years ago
I like it. Eliminating the cleaning thread would be nice. Happy to accept a Pull Request over in our fork that we intent to maintain and release from: https://github.com/hibernate-redis/hibernate-redis/
:(, sorry, it is in a private repository. If I use this lib again I will do it!
hiberate-redis 2.0.0 use Redisson library which has expiring logic by Lua.
Maybe this library can support another type of expiration strategy:
Today: Daemon cleaning Thread. Z scored set put on user put. Z verification ou user get.
Proposal: Store values with 8 bytes long prefix (expiration date) metadata. When user gets value, verify expiration metadata first. If expired, return null and send a delete command in background, if not return object. Define expiration of Hash to redis using command EXPIRE every time then a user put values to region Redis will clean entire Hash if anybody put new values (daybreak)
The idea is mantain both, and let user choose.