Publisher using Redis Publisher/Subscriber Package.
More...
#include <RedisPubSub.h>
Publisher using Redis Publisher/Subscriber Package.
RedisPublisher() publishes data in Redis server(broker).
RedisPublisher::RedisPublisher |
( |
| ) |
|
RedisPublisher::RedisPublisher |
( |
const string & |
host, |
|
|
int32_t |
port = 6379 |
|
) |
| |
Constructor.
- Parameters
-
[in] | host | Host IP address of the broker. |
[in] | port | Port number of the broker. |
RedisPublisher::~RedisPublisher |
( |
| ) |
|
int32_t RedisPublisher::init |
( |
| ) |
|
Initialize publisher and connect to broker.
- Return values
-
0 | Success |
-1 | Redis context was not allocated |
-2 | Redis context has some error condition |
int32_t RedisPublisher::publish |
( |
const string & |
name, |
|
|
const char * |
src_buf, |
|
|
int32_t |
size |
|
) |
| |
Publish data to the Redis server.
- Parameters
-
[in] | name | Name of data |
[in] | src_buf | Source buffer with data inside |
[in] | size | Size of data |
- Return values
-
n(>=0) | number of clients that received the data |
-1 | no Redis context(empty) |
-2 | redisCommand was not executed correctly |
-3 | redisCommand error |
std::shared_ptr<redisContext> RedisPublisher::m_context |
|
private |
Port number.
Redis context
string RedisPublisher::m_host |
|
private |
int32_t RedisPublisher::m_port |
|
private |
The documentation for this class was generated from the following files: