|
| | RedisClient (std::string address, size_t port) |
| |
| std::string | getSync (const std::string &key) |
| |
| void | getAsync (const std::string &key, const cpp_redis::reply_callback_t &reply_callback) |
| |
| void | getAsyncNoCommit (const std::string &key, const cpp_redis::reply_callback_t &reply_callback) |
| |
| void | setAsync (const std::string &key, const std::string &value) |
| |
| void | setSync (const std::string &key, const std::string &value) |
| |
| void | setNoCommit (const std::string &key, const std::string &value) |
| |
| void | asyncCommit () |
| |
| void | syncCommit () |
| |
| std::unordered_map< std::string, std::string > | getAllKeyValuePairs () |
| |
◆ RedisClient()
Client that communicates with the a redis server
- Parameters
-
| address | The IP of the Redis server, default localhost |
| port | the key of the Redis server, default 6379 |
◆ asyncCommit()
Asynchronously commit all pending requests since last commit.
◆ getAllKeyValuePairs()
| std::unordered_map< std::string, std::string > getAllKeyValuePairs |
( |
| ) |
|
- Returns
- a map of all the key value pairs in redis server
◆ getAsync()
| void getAsync |
( |
const std::string & |
key, |
|
|
const cpp_redis::reply_callback_t & |
reply_callback |
|
) |
| |
Gets the value corresponding to the key, non blocking - executes the callback once a reply is received.
- Parameters
-
| key | |
| reply_callback | callback function once the value is obtained |
◆ getAsyncNoCommit()
| void getAsyncNoCommit |
( |
const std::string & |
key, |
|
|
const cpp_redis::reply_callback_t & |
reply_callback |
|
) |
| |
Gets the value corresponding to the key, asynchronously but doesn't commit it. Must manually call asyncCommit() to commit it to the REDIS server.
Allows us to batch call a number of GET/SET requests to the REDIS server with one network request.
- Parameters
-
| key | |
| reply_callback | callback function once the value is obtained |
◆ getSync()
| std::string getSync |
( |
const std::string & |
key | ) |
|
Gets the value corresponding to the key; blocking
- Parameters
-
- Returns
- the value
◆ setAsync()
| void setAsync |
( |
const std::string & |
key, |
|
|
const std::string & |
value |
|
) |
| |
Sets a key value pair in the redis database asynchronously
- Parameters
-
◆ setNoCommit()
| void setNoCommit |
( |
const std::string & |
key, |
|
|
const std::string & |
value |
|
) |
| |
Sets a key value pair in the redis database but does not commit it. Waits for the next commit() to send it to the REDIS server.
Allows us to batch call a number of GET/SET requests to the REDIS server with one network request.
- Parameters
-
| key | key for key-value pair |
| value | value to set to key-value pair |
◆ setSync()
| void setSync |
( |
const std::string & |
key, |
|
|
const std::string & |
value |
|
) |
| |
Gets the value corresponding to the key; blocking synchronously
- Parameters
-
◆ syncCommit()
Synchronously commit all pending requests since last commit.
The documentation for this class was generated from the following files:
- src/software/embedded/redis/redis_client.h
- src/software/embedded/redis/redis_client.cpp