jhalterman / expiringmap

A high performance thread-safe map that expires entries
Apache License 2.0
998 stars 145 forks source link

Enterprise "expiringmap". #83

Open GianniAntini opened 1 year ago

GianniAntini commented 1 year ago

I Jonathan,

i'm using your map with great satisfaction. I wanted to know if you know of any tools to do the same thing at an enterprise level (especially for use with multiple pods).

I've had a look at redis or hazelcast, but they don't seem to have the option to set different expirations for each key.

thanks

jhalterman commented 1 year ago

Hi @GianniAntini Unfortunately there's nothing that I offer or that I'm aware of that does per-key expiration for a replicated map.

r0bb3n commented 10 months ago

Hi @GianniAntini ,

they don't seem to have the option to set different expirations for each key

at least for redis, this is not true, see the SET command (docs). It supports several ways to do that for each entry:

SET key value [NX | XX] [GET] [EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL]