Added MGetCache helper in rueidiscompat#951
Closed
akshaykhairmode wants to merge 1 commit intoredis:mainfrom
Closed
Added MGetCache helper in rueidiscompat#951akshaykhairmode wants to merge 1 commit intoredis:mainfrom
akshaykhairmode wants to merge 1 commit intoredis:mainfrom
Conversation
rueian
reviewed
Feb 8, 2026
| } | ||
|
|
||
| // MGetCache will internally call rueidis.MGetCache which only sends the keys to server which are not in cache. | ||
| func (c CacheCompat) MGetCache(ctx context.Context, keys ...string) *SliceCmd { |
Collaborator
There was a problem hiding this comment.
I think there is no need for adding MGetCache to CacheCompat. Please just use rueidis.MGetCache.
Contributor
Author
There was a problem hiding this comment.
understood 👍
| func (c *Compat) Cache(ttl time.Duration) CacheCompat { | ||
| return CacheCompat{client: c.client, ttl: ttl} | ||
| func (c *Compat) Cache(ttl time.Duration) CacheCmdable { | ||
| return &CacheCompat{client: c.client, ttl: ttl} |
Collaborator
There was a problem hiding this comment.
Returning the CacheCmdable struct is intentional to avoid unnecessary allocations.
Contributor
Author
There was a problem hiding this comment.
oh, it will get moved to the heap right?
Contributor
Author
|
Understood, closing this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added MGetCache helper equivalent to compat.
Add new interface CacheCmdable.
Hello, Please review.