-
Notifications
You must be signed in to change notification settings - Fork 173
Closed
Milestone
Description
Background
Each backend cache implementation is currently split into two classes, with the "interface" class derived from the "backend" class.
SimpleMemoryCachesubclassesSimpleMemoryBackend, which subclassesBaseCache[str].MemcachedCachesubclassesMemcachedBackend, which subclassesBaseCache[bytes].RedisCachesubclassesRedisBackend, which subclassesBaseCache[str].
Suggestion
Merge each pair into a single subclass of BaseClass. In other words, the ...Backend classes do not appear to provide any benefit or value by being distinct classes.
SimpleMemoryCacheis highly bound toSimpleMemoryBackend, even in its name. It seems unlikely that anyone would useSimpleMemoryBackenddirectly, rather than usingSimpleMemoryCache.- Also
SimpleMemoryBackenddoes not appear to provide value as a base class for user customization. If a specialized memory cache is needed, one would probably derive fromSimpleMemoryCacheand override only what is needed, or derive fromBaseCacheif more extensive changes are required.
Question
Are any aiocache users relying on SimpleMemoryBackend, MemcachedBackend, RedisBackend classes, or could their functionality be merged into the corresponding ...Cache implementations?
Tsovak and mikeoconnor0308
Metadata
Metadata
Assignees
Labels
No labels