Open deanwong opened 7 years ago
ExpiringMap always wants to expire things, thus the name :)
The best you can do is set expiration to be something very far off: such as Integer.MAX_VALUE
TimeUnit.DAYS
.
Is it possible to use -1? In this case it should not expire at all right?
Is your use case trying to mix things that should never expire with things that do in the same map? Currently there's no way to indicate that an entry should never expire, but I'd be happy to take a PR that allows negative values to indicate an entry should not expire.
If someone is up for this, this would and should only work with dynamic expiration though, else the put should be rejected with IllegalArgumentException.
when I use put(K key, V value) the default expiration time is 1 min.