Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RedisCache #5

Merged
merged 6 commits into from
Oct 18, 2019
Merged

Add RedisCache #5

merged 6 commits into from
Oct 18, 2019

Conversation

tyzhnenko
Copy link
Contributor

Issue #3

Copy link
Member

@umputun umputun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx for the PR. In addition to things above it has two more parts missing:

  1. Tests
  2. Change in README

options.go Outdated Show resolved Hide resolved
redis_cache.go Show resolved Hide resolved
redis_cache.go Outdated Show resolved Hide resolved
redis_cache.go Outdated Show resolved Hide resolved
redis_cache.go Outdated Show resolved Hide resolved
redis_cache.go Show resolved Hide resolved
redis_cache.go Show resolved Hide resolved
@umputun
Copy link
Member

umputun commented Oct 15, 2019

pls let me know as pr is good for review. I got a bunch of commits notifications and have no way to figure if this commit was final or not.

@tyzhnenko
Copy link
Contributor Author

pls let me know as pr is good for review. I got a bunch of commits notifications and have no way to figure if this commit was final or not.

Ok. I'll ping you. I'm trying to understand how can I properly use BinaryMarshaler/Unmarshaler due redis client can't convert sizerString properly and want this interface.

@tyzhnenko
Copy link
Contributor Author

pls let me know as pr is good for review. I got a bunch of commits notifications and have no way to figure if this commit was final or not.

I've updated pull request, fix readme and add tests.
I have no idea how to add cache size to RedisCache in simple way that's why I skip size assertion in tests. I mean onEvicted hook at expired keys.
Also I had to force convert string to sizedString due Redis client return value as only string

@umputun
Copy link
Member

umputun commented Oct 15, 2019

I have no idea how to add cache size to RedisCache in simple way that's why I skip size assertion in tests. I mean onEvicted hook at expired keys.

ok, it makes sense. I think you can drop this data-size support in case of redis completely. The original goal was to limit in-process memory consumption for the regular caches, but for redis the only size limit making some sense is the number of pairs we store. I mean, redis memory control is not really a concern we should address here.

@tyzhnenko
Copy link
Contributor Author

I have no idea how to add cache size to RedisCache in simple way that's why I skip size assertion in tests. I mean onEvicted hook at expired keys.

ok, it makes sense. I think you can drop this data-size support in case of redis completely. The original goal was to limit in-process memory consumption for the regular caches, but for redis the only size limit making some sense is the number of pairs we store. I mean, redis memory control is not really a concern we should address here.

Can you make a review of the latest change set? I'd like to have full list of problems :) and then I'll go to fix them all at once

redis_cache.go Outdated Show resolved Hide resolved
@umputun
Copy link
Member

umputun commented Oct 16, 2019

Added just a few minor things

@tyzhnenko
Copy link
Contributor Author

Added just a few minor things

Please take a loop the latest changes. It looks like I made all necessary changes which were pointed in comments

redis_cache.go Outdated Show resolved Hide resolved
Copy link
Member

@umputun umputun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thx!

@umputun umputun merged commit 711af43 into go-pkgz:master Oct 18, 2019
@tyzhnenko tyzhnenko deleted the add_redis_cache branch October 18, 2019 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants