Re: [go-nuts] Expiring map

2017-07-24 Thread DanB
Rajanikanth, If it helps you, have a look on the library we have posted which follows ideas out of implementation of groupcache/lru.go, adding expiring capabilities to LRU (same logic of list indexing behind): https://github.com/cgrates/ltcache DanB On Friday, July 21, 2017 at 2:01:15 AM

Re: [go-nuts] Expiring map

2017-07-20 Thread Rajanikanth Jammalamadaka
Thanks for the replies. Sameer: it would be awesome if you can open source them. Thanks, Rajanikanth On Thu, Jul 20, 2017, 7:47 PM Sameer Ajmani wrote: > We have a few implementations of this inside Google (expiring.Map, > timedcache, and lru.Cache). It might make sense to

Re: [go-nuts] Expiring map

2017-07-20 Thread Sameer Ajmani
We have a few implementations of this inside Google (expiring.Map, timedcache, and lru.Cache). It might make sense to open source these, if they have no internal dependencies. On Wed, Jul 19, 2017 at 3:22 PM Rajanikanth Jammalamadaka < rajanika...@gmail.com> wrote: > Does somebody have a

Re: [go-nuts] Expiring map

2017-07-19 Thread Bakul Shah
On Wed, 19 Jul 2017 19:32:32 - Jan Mercl <0xj...@gmail.com> wrote: > > 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

Re: [go-nuts] Expiring map

2017-07-19 Thread Jesper Louis Andersen
A queue of keys stamped with the creation timestamp allows for dropping elements from the front easily. This makes the expiration cheap, but pays in memory resources. Jan's suggestion is subtly cheaper from a memory perspective, but pays with a bit more CPU cycles. Since this is just a simple

Re: [go-nuts] Expiring map

2017-07-19 Thread Rajanikanth Jammalamadaka
Thanks Shawn/Jan On Wednesday, July 19, 2017 at 3:32:59 PM UTC-4, Jan Mercl wrote: > > > On Wed, Jul 19, 2017 at 9:22 PM Rajanikanth Jammalamadaka < > rajan...@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

Re: [go-nuts] Expiring map

2017-07-19 Thread Jan Mercl
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

Re: [go-nuts] Expiring map

2017-07-19 Thread Shawn Milochik
On Wed, Jul 19, 2017 at 3: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? > > > It's not expensive to get

[go-nuts] Expiring map

2017-07-19 Thread Rajanikanth Jammalamadaka
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? Thanks, Raj -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe