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
RedisStorefor this client.
-
set(name, value, ex=None, px=None, nx=False, xx=False)[source]¶ Set the value at key
nametovalueParameters: - ex – sets an expire flag on key
nameforexseconds. - px – sets an expire flag on key
nameforpxmilliseconds. - nx – if set to True, set the value at key
nametovalueif it does not already exist. - xx – if set to True, set the value at key
nametovalueif 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.startandnumallow for paging through the sorted databyallows using an external key to weight and sort the items.- Use an “*” to indicate where in the key the item value is located
getallows 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
descallows for reversing the sortalphaallows for sorting lexicographically rather than numericallystoreallows for storing the result of the sort into- the key
store groupsif set to True and ifgetcontains 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.