Available Clients¶
Redis¶
Pulsar is shipped with a Store
implementation for redis
and pulsard-ds servers.
Redis Store¶
Redis Client¶
-
class
pulsar.apps.data.redis.client.
RedisClient
(store)[source]¶ Client for
RedisStore
.-
store
¶ The
RedisStore
for this client.
-
set
(name, value, ex=None, px=None, nx=False, xx=False)[source]¶ Set the value at key
name
tovalue
Parameters: - ex – sets an expire flag on key
name
forex
seconds. - px – sets an expire flag on key
name
forpx
milliseconds. - nx – if set to True, set the value at key
name
tovalue
if it does not already exist. - xx – if set to True, set the value at key
name
tovalue
if it already exists.
- ex – sets an expire flag on key
-
zadd
(name, *args, **kwargs)[source]¶ Set any number of score, element-name pairs to the key
name
. Pairs can be specified in two ways:As
*args
, in the form of:score1, name1, score2, name2, ...
or as
**kwargs
, in the form of:name1=score1, name2=score2, ...
The following example would add four values to the ‘my-key’ key:
client.zadd('my-key', 1.1, 'name1', 2.2, 'name2', name3=3.3, name4=4.4)
-
sort
(key, start=None, num=None, by=None, get=None, desc=False, alpha=False, store=None, groups=False)[source]¶ Sort and return the list, set or sorted set at
key
.start
andnum
allow for paging through the sorted databy
allows using an external key to weight and sort the items.- Use an “*” to indicate where in the key the item value is located
get
allows for returning items from external keys rather than the- sorted data itself. Use an “*” to indicate where int he key the item value is located
desc
allows for reversing the sortalpha
allows for sorting lexicographically rather than numericallystore
allows for storing the result of the sort into- the key
store
groups
if set to True and ifget
contains at least two- elements, sort will return a list of tuples, each containing the
values fetched from the arguments to
get
.
-
PulsarDs¶
It has the same implementation as redis client.