This is simply the CachedSerializer support from the earlier PR.
Instead of calling compat.pickle operations, a backend declares a cached_serializer. By default, everything supporting serialization uses a Pickle serializer (which uses compat.pickle). Overriding a serializer is accomplished by passing in an instance that supports loads and dumps methods. Registration is modeled the same way as the wraps.
The memcached backend is untested. It uses a PassthroughCachedSerializer though a conditional 'dumps/loads' like the memory backend might be better.
Second attempt at solving #18
This is simply the CachedSerializer support from the earlier PR.
Instead of calling
compat.pickle
operations, a backend declares acached_serializer
. By default, everything supporting serialization uses a Pickle serializer (which usescompat.pickle
). Overriding a serializer is accomplished by passing in an instance that supportsloads
anddumps
methods. Registration is modeled the same way as thewraps
.The memcached backend is untested. It uses a
PassthroughCachedSerializer
though a conditional 'dumps/loads' like the memory backend might be better.