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

Redis to valkey? #882

Open
mlathara opened this issue Aug 5, 2024 · 4 comments
Open

Redis to valkey? #882

mlathara opened this issue Aug 5, 2024 · 4 comments

Comments

@mlathara
Copy link

mlathara commented Aug 5, 2024

I was wondering if there was any interest or ongoing work in migrating from redis to valkey? Or in adding valkey as a separate backend for this project?

@Dreamsorcerer
Copy link
Member

If someone wants to do the work, I think switching the existing redis backend to valkey would be fine.

@jules-ch
Copy link

jules-ch commented Nov 10, 2024

Monkeypatching should do the trick:

>>> import valkey.asyncio as redis
>>> redis.Redis = redis.Valkey # valkey does not ship with Redis in asyncio module
>>> from aiocache import BaseCache, Cache
>>> aiocache.backends.redis.redis = redis

>>> cache = Cache.from_url(settings.CACHE_URL)
<valkey.client.Valkey(<valkey.connection.ConnectionPool(<valkey.connection.Connection(host=127.0.0.1,port=6379,db=0)>)>)>

@Dreamsorcerer
Copy link
Member

If all you need is to change the import, should be simple to create a PR, rather than monkeypatching.

@jules-ch
Copy link

People might be interested in choosing their client either redis or valkey.
Creating a dedicated backend might be the way to do just that.

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

No branches or pull requests

3 participants