5.6.1.4. vlcp.service.connection.redisdb¶
Note
This document is generated from the source file.
Created on 2016/3/8
author: | hubo |
---|
-
class
vlcp.service.connection.redisdb.
RedisDB
(server)¶ Create redis clients to connect to redis server
-
__init__
(server)¶ Constructor
-
delete
(key, vhost='')¶ Delete a key from the storage
-
get
(key, timeout=None, vhost='')¶ Get value from key
-
getclient
(vhost='')¶ Return a tuple of
(redisclient, encoder, decoder)
for specified vhost
-
listallkeys
(vhost='')¶ Return all keys in the KVDB. For management purpose.
-
mget
(keys, vhost='')¶ Get multiple values from multiple keys
-
mgetwithcache
(keys, vhost='', cache=None)¶ Get multiple values, cached when possible
-
mset
(kvpairs, timeout=None, vhost='')¶ Set multiple values on multiple keys
-
mupdate
(keys, updater, timeout=None, vhost='')¶ Update multiple keys in-place with a custom function, see update. Either all success, or all fail.
-
set
(key, value, timeout=None, vhost='')¶ Set value to key, with an optional timeout
-
update
(key, updater, timeout=None, vhost='')¶ Update in-place with a custom function
Parameters: - key – key to update
- updater –
func(k,v)
, should return a new value to update, or return None to delete. The function may be call more than once. - timeout – new timeout
Returns: the updated value, or None if deleted
-
updateall
(keys, updater, timeout=None, vhost='')¶ Update multiple keys in-place, with a function
updater(keys, values)
which returns(updated_keys, updated_values)
.Either all success or all fail
-
updateallwithtime
(keys, updater, timeout=None, vhost='')¶ Update multiple keys in-place, with a function
updater(keys, values, timestamp)
which returns(updated_keys, updated_values)
.Either all success or all fail.
Timestamp is a integer standing for current time in microseconds.
-
-
exception
vlcp.service.connection.redisdb.
RedisWriteConflictException
¶