-
Notifications
You must be signed in to change notification settings - Fork 148
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
Use encoding from the serializer if specified #7
Comments
Need to think more about it. Redis for example needs always to have an encoding when calling The problem is that if this logic is moved to the serializers, depending on which backend is using it, it must explicitly say which encoding must use every time is being initialized... |
This definitely has to go to the serializer side, have a look at #20. The methods become messy just because the |
Can't be moved 100% to serializers... the users shouldnt know which encoding the backend does support but the backend can't deal 100% with that either. For example, the following case: Imagine we set 'utf-8' as encoding for Redis backend. It stores bytes but then we want to retrieve strings so we are encoding/decoding every time a new value is saved/retrieved. Now imagine we are using the Pickleserializer which by default it already returns bytes... a Still need to think how to get around with this. Updated a bit the logic but the problem persists. |
With #42 it may be possible to implement |
There is an
encoding
attr defined for serializer because in some cases it is needed for aioredis. To keep the interface clean, the encoding part should be done in the serializer layer. This will help also in the case ofmemcached
implementationThe text was updated successfully, but these errors were encountered: