-
Notifications
You must be signed in to change notification settings - Fork 97
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
Support Redis #68
Comments
Another problem is that, the trait is returning references, for example:
So when I fetch a value from Redis, it's initiated inside the function, then it's not possible to return the reference to it! A solution can be to store them in a hashmap inside the struct and return the ref to that. But I don't know how to clear the memory up after it went out of scope. |
Yeah the reference thing is a problem. The last time I was thinking about this, I was thinking of making a separate trait where the |
@jaemk I've spent some time on this, couldn't figure it out :( |
Would it make sense to add Redis support behind a feature flag? So a user would add something like this in their Cargo.toml when they want to include the crate:
I agree that it’s a good thing to include, but it might be a bit much to include it by default. |
@seanchen1991 Sure it will be behind a feature flag. |
I'd love to use the |
Hey @PeterGrace, it's kinda a prerequisite for this one. By now, |
@PeterGrace I just pushed the sync redis support to the PR, #72. |
I suggest supporting any network-based cache software, like Redis, Memcached, and ...
In the k8s environment, in which you may have several small pods working at the same time, caching locally is not helpful enough and will increase memory usage which may end in OOM Kill, having a shared place to cache the data is helpful.
If you agree, I can start trying to do it.
By adding a new store type,
RedisCache
which I hope will be similar toTimedCache
andUnboundCache
.To support this, I think the return type of the function must implement
Serialize
andDeserialize
.The text was updated successfully, but these errors were encountered: