structures Package¶
base
Module¶
hash
Module¶
-
class
stream_framework.storage.redis.structures.hash.
BaseRedisHashCache
(key, redis=None)[source]¶ Bases:
stream_framework.storage.redis.structures.base.RedisCache
-
key_format
= 'redis:base_hash_cache:%s'¶
-
-
class
stream_framework.storage.redis.structures.hash.
FallbackHashCache
(key, redis=None)[source]¶ Bases:
stream_framework.storage.redis.structures.hash.RedisHashCache
Redis structure with fallback to the database
-
get_many_from_fallback
(missing_keys)[source]¶ Return a dictionary with the serialized values for the missing keys
-
key_format
= 'redis:db_hash_cache:%s'¶
-
-
class
stream_framework.storage.redis.structures.hash.
RedisHashCache
(key, redis=None)[source]¶ Bases:
stream_framework.storage.redis.structures.hash.BaseRedisHashCache
-
key_format
= 'redis:hash_cache:%s'¶
-
-
class
stream_framework.storage.redis.structures.hash.
ShardedDatabaseFallbackHashCache
(key, redis=None)[source]¶ Bases:
stream_framework.storage.redis.structures.hash.ShardedHashCache
,stream_framework.storage.redis.structures.hash.FallbackHashCache
-
class
stream_framework.storage.redis.structures.hash.
ShardedHashCache
(key, redis=None)[source]¶ Bases:
stream_framework.storage.redis.structures.hash.RedisHashCache
Use multiple keys instead of one so its easier to shard across redis machines
-
number_of_keys
= 10¶
-
list
Module¶
-
class
stream_framework.storage.redis.structures.list.
BaseRedisListCache
(key, redis=None)[source]¶ Bases:
stream_framework.storage.redis.structures.base.RedisCache
Generic list functionality used for both the sorted set and list implementations
Retrieve the sorted list/sorted set by using python slicing
-
key_format
= 'redis:base_list_cache:%s'¶
-
max_length
= 100¶
-
-
class
stream_framework.storage.redis.structures.list.
FallbackRedisListCache
(key, redis=None)[source]¶ Bases:
stream_framework.storage.redis.structures.list.RedisListCache
Redis list cache which after retrieving all items from redis falls back to a main data source (like the database)
-
get_redis_results
(start, stop)[source]¶ Returns the results from redis
Parameters: - start – the beginning
- stop – the end
-
key_format
= 'redis:db_list_cache:%s'¶
-
-
class
stream_framework.storage.redis.structures.list.
RedisListCache
(key, redis=None)[source]¶ Bases:
stream_framework.storage.redis.structures.list.BaseRedisListCache
-
key_format
= 'redis:list_cache:%s'¶
-
max_items
= 1000¶ the maximum number of items the list stores
-
sorted_set
Module¶
-
class
stream_framework.storage.redis.structures.sorted_set.
RedisSortedSetCache
(key, redis=None)[source]¶ Bases:
stream_framework.storage.redis.structures.list.BaseRedisListCache
,stream_framework.storage.redis.structures.hash.BaseRedisHashCache
-
get_results
(start=None, stop=None, min_score=None, max_score=None)[source]¶ Retrieve results from redis using zrevrange O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements returned.
-
sort_asc
= False¶
-