-
-
Notifications
You must be signed in to change notification settings - Fork 19
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 Valkey support #106
base: master
Are you sure you want to change the base?
Add Valkey support #106
Conversation
The scenario of this implementation is ok 👍🏽
That is not a problem, users can use both of them, but in the implementation of the core we gave more priority to |
one thought that came to my mind was to go with something close to what django does, which adds a good amount of costumizibillity, tho it's more code. |
I'm ok with the current style but I'm not sure what you mean by something close to Django and something more customizable, please give me an overview of what you have in mind. |
db: DatabaseConnection = DatabaseConnection() | ||
redis: RedisConnection = RedisConnection() | ||
valkey: ValkeyConnection = ValkeyConnection() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we have so many places that use redis
and we have to or
them with valkey
, I think it would be better to have a variable named cache
which stores the correct value.
And if we go with this new style, we have to have a new abstract class for the redis
and valkey
to save the structure
in django you set any cache backend you have in a dictionary like this: example then, django provides you with this two objects. it has a number of features, such as:
and you don't have to check which server has been configured, which is gonna cause problem as this package grows anyway, it's just a thought, i'll write this the way you prefer. |
This is a good thought, I'll come back to you ... |
I searched a bit and because the usage and interface of other caches are not the same enough I think it is better to implement them separately, as you did, Otherwise it needs a huge amount of code to wrap all of them. |
hi! it's a trade off. I'll get to work in a day or two, have to fix a broken CI first :/ |
db: DatabaseConnection = DatabaseConnection() | ||
redis: RedisConnection = RedisConnection() | ||
valkey: ValkeyConnection = ValkeyConnection() | ||
|
||
if redis.is_connected: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The is_connected
attr only can be True
after the Panther.load_configs()
so this condition is not right.
You may want to use design patterns for this variable, I'm going to think about the best solution too, and I'll come back to you if I find any.
@@ -148,7 +148,7 @@ def print_info(config: Config): | |||
|
|||
# Message | |||
info_message = f"""{logo} | |||
{h} Redis: {rd} \t {h} | |||
{h} Cache Server: {rd} \t {h} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the spacing between {rd}
and \t
hi
this is just a prototype, check if you're okay with the way i went, then i'll try to add valkey to the rest of the codebase
one problem with this method is that you can only have redis or valkey, and not both