Yes, time.Duration and maybe another argument for ticker interval as
time.Duration as well.
On Wednesday, October 9, 2024 at 4:31:24 AM UTC+2 Cleberson Pedreira
Pauluci wrote:
> Hello. I found this very interesting.
>
> I have some questions:
>
> Have you considered the possibility of using *ti
I've found this package to be useful for this in the past:
https://github.com/jellydator/ttlcache
On Wed, Oct 9, 2024, 04:31 Cleberson Pedreira Pauluci <
pauluci.cleber...@gmail.com> wrote:
> Hello. I found this very interesting.
>
> I have some questions:
>
> Have you considered the possibility
Hello. I found this very interesting.
I have some questions:
Have you considered the possibility of using *time.Duration* for the
*maxTTL* parameter?
Maybe wouldn't it be more interesting if each item had its own *maxTTL*
instead of just one for any item on the map?
If you'll allow me, I made
Ah you are right. I need to sleep. I read this code wrong, twice. Just
ignore me.
On Tuesday 8 October 2024 at 21:45:51 UTC+2 Alex Pliutau wrote:
> It's one goroutine for all currently. Which is more efficient than
> checking each item individually.
>
> On Tuesday, October 8, 2024 at 9:10:16 P
It's one goroutine for all currently. Which is more efficient than checking
each item individually.
On Tuesday, October 8, 2024 at 9:10:16 PM UTC+2 Nico Braun wrote:
> Well, you do that already. Except its having 1 goroutine per entry. Maybe
> 1 goroutine for all would be enough.
>
> On Tuesday
Well, you do that already. Except its having 1 goroutine per entry. Maybe 1
goroutine for all would be enough.
On Tuesday 8 October 2024 at 21:07:22 UTC+2 Nico Braun wrote:
> Hi, isnt this kind of inefficient? I think it would be better without
> tickers and extra goroutines. You could check if
Hi, isnt this kind of inefficient? I think it would be better without
tickers and extra goroutines. You could check if an item is expired when
trying to fetch it. And then you do periodic compaction to make sure old
stuff is freed up, eventually.
On Monday 7 October 2024 at 21:37:53 UTC+2 Alex