You can use different caches according to your needs. All the caches implement the same interface.
Caches are always working together with a serializer which transforms data when storing and retrieving from the backend. It may also contain plugins that are able to enrich the behavior of your cache (like adding metrics, logs, etc).
This is the flow of the
Let’s go with a more specific case. Let’s pick Redis as the cache with namespace “test” and PickleSerializer as the serializer:
- We receive
pre_setof all attached plugins (none by default) is called.
- “key” will become “test:key” when calling
- “value” will become an array of bytes when calling
- the byte array is stored together with the key using
setcmd in Redis.
post_setof all attached plugins is called.
By default, all commands are covered by a timeout that will trigger an
asyncio.TimeoutError in case of timeout. Timeout can be set at instance level or when calling the command.
The supported commands are:
If you feel a command is missing here do not hesitate to open an issue