abstract#
Implement an abstract cache backend. You can customize your own cache backend.
- class pynamodb_mate.patterns.cache.abstract.CacheRecord(value: bytes, expire: int, update_ts: int)[source]#
Represent a cache record.
- Parameters:
key – the cache key
value – the binary view of the original value
expire – cache expire time, in seconds
update_ts – last update timestamp
- class pynamodb_mate.patterns.cache.abstract.AbstractCache(*args, **kwds)[source]#
An abstract cache class regardless of the backend.
- abstract serialize(value: VALUE) bytes [source]#
Abstract serialization function that convert the original value to binary data.
- abstract deserialize(value: bytes) VALUE [source]#
Abstract deserialization function the recover the original value from binary data.