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

Allow for targeting one Redis store while using indexes as key prefixes #32

Open
FasterSpeeding opened this issue Jul 9, 2021 · 2 comments

Comments

@FasterSpeeding
Copy link
Owner

FasterSpeeding commented Jul 9, 2021

To account for scenarios where a redis cache is already being used for other parts of a bot letting people target a single redis store while prefixing keys with indexes as an alternative approach may be helpful.

I'm thinking that with the recent addition of fb2219d redis.ResourceClient could have a toggle on it which switches it between two different key strategies where one formats all the keys as something along the lines of "{index}:{actual_id}" (where overrides don't effect the used index) while the other is just the actual id and a short hand method which sets overrides for all the known indexes so that switching over to a prefix cache implementation would look something like

cli = RedisClient(...).key_prefixing(True).override_all_indexes(int)
@FasterSpeeding
Copy link
Owner Author

This may actually be worth considering as the main/only behaviour

@FasterSpeeding FasterSpeeding moved this to To do in Sake Dec 30, 2022
@sdf9s8d76f
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To do
Development

No branches or pull requests

2 participants