On Wed, Jul 19, 2017 at 9:22 PM Rajanikanth Jammalamadaka <
rajanika...@gmail.com> wrote:

> Does somebody have a recommendation for an expiring dict? If I have to
write my own, is there a way to avoid iterating over all the keys to delete
the expired entries?

Common approach is to tag the entries with insertion or expiration time and
remove invalid items only on retrieval. If there are not enough retrievals
that keep the ratio of useful/expired map entries sane, a "cleaner"
goroutine can be run concurrently.




-- 

-j

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to