Newer
Older
setKey("DAQ_key");
this->stream = rediscpp::make_stream("localhost", "6379");
}
RedisProvider::RedisProvider(std::string ip, int port, std::string key) {
this->stream = rediscpp::make_stream(ip, std::to_string(port));
auto response = rediscpp::execute(*stream, "set",
getKey(), (char *) packet.getBufferPtr());
std::flush(*stream);
int RedisProvider::write(BasePacket &packet, std::string key) {
int RedisProvider::open() {
try {
auto response = rediscpp::execute(*stream, "ping");
std::cerr << "Redis Connection Error: " << e.what() << std::endl;
std::cout << "Flushing..." << std::endl;
std::flush(*stream);
RedisProvider::~RedisProvider(){
std::cout << "Deleting Redis stream" << std::endl;
}