cpp_redis
4.0.0
cpp_redis is a C++11 Asynchronous Multi-Platform Lightweight Redis Client, with support for synchronous operations and pipelining.
|
#include <tcp_client_iface.hpp>
Classes | |
struct | read_request |
struct | read_result |
struct | write_request |
struct | write_result |
Public Types | |
typedef std::function< void(read_result &)> | async_read_callback_t |
typedef std::function< void(write_result &)> | async_write_callback_t |
typedef std::function< void()> | disconnection_handler_t |
Public Member Functions | |
tcp_client_iface (void)=default | |
ctor | |
virtual | ~tcp_client_iface (void)=default |
dtor | |
virtual void | connect (const std::string &addr, std::uint32_t port, std::uint32_t timeout_msecs=0)=0 |
virtual void | disconnect (bool wait_for_removal=false)=0 |
virtual bool | is_connected (void) const =0 |
virtual void | async_read (read_request &request)=0 |
virtual void | async_write (write_request &request)=0 |
virtual void | set_on_disconnection_handler (const disconnection_handler_t &disconnection_handler)=0 |
interface defining how tcp client should be implemented to be used inside cpp_redis
typedef std::function<void(read_result&)> cpp_redis::network::tcp_client_iface::async_read_callback_t |
async read completion callbacks function taking read_result as a parameter
typedef std::function<void(write_result&)> cpp_redis::network::tcp_client_iface::async_write_callback_t |
async write completion callbacks function taking write_result as a parameter
typedef std::function<void()> cpp_redis::network::tcp_client_iface::disconnection_handler_t |
disconnection handler
|
pure virtual |
async read operation
request | information about what should be read and what should be done after completion |
Implemented in cpp_redis::network::tcp_client.
|
pure virtual |
async write operation
request | information about what should be written and what should be done after completion |
Implemented in cpp_redis::network::tcp_client.
|
pure virtual |
start the tcp client
addr | host to be connected to |
port | port to be connected to |
timeout_msecs | max time to connect in ms |
Implemented in cpp_redis::network::tcp_client.
|
pure virtual |
stop the tcp client
wait_for_removal | when sets to true, disconnect blocks until the underlying TCP client has been effectively removed from the io_service and that all the underlying callbacks have completed. |
Implemented in cpp_redis::network::tcp_client.
|
pure virtual |
Implemented in cpp_redis::network::tcp_client.
|
pure virtual |
set on disconnection handler
disconnection_handler | handler to be called in case of a disconnection |
Implemented in cpp_redis::network::tcp_client.