muesli / cache2go

Concurrency-safe Go caching library with expiration capabilities and access counters
Other
2.11k stars 518 forks source link

Callback queue #29

Closed trapajim closed 5 years ago

trapajim commented 5 years ago

i've added a simple fifo queue for the callbacks. requested in #19

muesli commented 5 years ago

Nice contribution, thank you!

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 32afdb1a7abfae10ae7fa9e08a0850fc1d1a371d on trapajim:callback_queue into 46a3a44c1a5f7a4623fd15c89a77f45bd0478198 on muesli:master.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 4003e6e51bee7c863aa3ab0fce2849703bc31a4e on trapajim:callback_queue into 46a3a44c1a5f7a4623fd15c89a77f45bd0478198 on muesli:master.

muesli commented 5 years ago

Awesome, thanks for updating. One more thing occurred to me in the meantime though:

this could lead to breaking existing clients, if they relied on the behavior of the old callbacks being overwritten.

Here's an idea: how about we keep the set*Callback methods overwriting the entire list of callbacks, and add new add*Callback methods for the new functionality?

trapajim commented 5 years ago

Awesome, thanks for updating. One more thing occurred to me in the meantime though:

this could lead to breaking existing clients, if they relied on the behavior of the old callbacks being overwritten.

Here's an idea: how about we keep the set*Callback methods overwriting the entire list of callbacks, and add new add*Callback methods for the new functionality?

That makes sense, I didn't think about that. I'll implement that soon.

trapajim commented 5 years ago

@muesli just checking in if you saw the changes

muesli commented 5 years ago

@trapajim I'm terribly sorry, it seems I have indeed missed that notification! Thanks for your contributions, really appreciated!