redis Package

activity_storage Module

class stream_framework.storage.redis.activity_storage.ActivityCache(key, redis=None)[source]

Bases: stream_framework.storage.redis.structures.hash.ShardedHashCache

key_format = 'activity:cache:%s'
class stream_framework.storage.redis.activity_storage.RedisActivityStorage(serializer_class=None, activity_class=None, **options)[source]

Bases: stream_framework.storage.base.BaseActivityStorage

add_to_storage(serialized_activities, *args, **kwargs)[source]
default_serializer_class

alias of ActivitySerializer

flush()[source]
get_cache()[source]
get_from_storage(activity_ids, *args, **kwargs)[source]
get_key()[source]
remove_from_storage(activity_ids, *args, **kwargs)[source]

connection Module

stream_framework.storage.redis.connection.get_redis_connection(server_name='default')[source]

Gets the specified redis connection

stream_framework.storage.redis.connection.setup_redis()[source]

Starts the connection pool for all configured redis servers

timeline_storage Module

class stream_framework.storage.redis.timeline_storage.RedisTimelineStorage(serializer_class=None, activity_class=None, **options)[source]

Bases: stream_framework.storage.base.BaseTimelineStorage

add_to_storage(key, activities, batch_interface=None)[source]
contains(key, activity_id)[source]
count(key)[source]
delete(key)[source]
get_batch_interface()[source]
get_cache(key)[source]
get_index_of(key, activity_id)[source]
get_slice_from_storage(key, start, stop, filter_kwargs=None, ordering_args=None)[source]

Returns a slice from the storage :param key: the redis key at which the sorted set is located :param start: the start :param stop: the stop :param filter_kwargs: a dict of filter kwargs :param ordering_args: a list of fields used for sorting

Example::
get_slice_from_storage(‘feed:13‘, 0, 10, {activity_id__lte=10})
remove_from_storage(key, activities, batch_interface=None)[source]
trim(key, length, batch_interface=None)[source]
class stream_framework.storage.redis.timeline_storage.TimelineCache(key, redis=None)[source]

Bases: stream_framework.storage.redis.structures.sorted_set.RedisSortedSetCache

sort_asc = False