sasa1977 / con_cache

ets based key/value cache with row level isolated writes and ttl support
MIT License
910 stars 71 forks source link

Require value for ttl when using Item as value #74

Closed tfwright closed 7 months ago

tfwright commented 7 months ago

Resolves https://github.com/sasa1977/con_cache/issues/73

@sasa1977 thanks for considering these changes

I may have gone a little overboard on the README example changes. Let me know if you want me to scale that back :)

When considering addressing the use of the Item struct, it seemed like this line is conveying the point so I just changed it a bit to make the intention of the example more explicit.

Also, I normally wouldn't test code like this but let me know if you'd prefer to add something.

Finally, if you think this change does make sense, I wonder whether the value should be required as well?

sasa1977 commented 7 months ago

Thanks! This looks fine to me. I agree that we should make value required too. I know it's strictly speaking not related to this PR, but I'm fine with sneaking it in :-)

tfwright commented 7 months ago

@sasa1977 snuck it in :)

sasa1977 commented 7 months ago

Finally merged, sorry for the delay, was a bit busy. Thanks for the contribution!