go-cache icon indicating copy to clipboard operation
go-cache copied to clipboard

Add a method to get all Items in a thread safe manner.

Open hikhvar opened this issue 9 years ago • 4 comments

As discussed in Issue #36 I needed a way to get all not expired items. This PR add such a method. Test and Benchmarks are included. Feel free to make any suggestions.

hikhvar avatar Aug 31 '16 08:08 hikhvar

Any chance to get this included?

totallyunknown avatar Oct 02 '16 14:10 totallyunknown

Thank you for this. I modified Items() to return a new map with unexpired items https://github.com/patrickmn/go-cache/commit/a2d8b56f0c21c5562c23717b6137ed6254ddc6d4

Would you be willing to change this PR to add your test against Items() and adding yourself to CONTRIBUTORS?

patrickmn avatar Nov 25 '16 19:11 patrickmn

Hey, I updated the pull request.

hikhvar avatar Nov 28 '16 07:11 hikhvar

Found this fork: https://github.com/arp242/zcache

pablodz avatar Jan 03 '24 02:01 pablodz