View on GitHub

Thrift Asio

Asynchronous client and server for apache thrift implemented via boost::asio

Download this project as a .zip file Download this project as a tar.gz file
betabugs::networking::thrift_asio_client< ClientType, ProcessorType, HandlerInterfaceType > Class Template Reference

An asynchronous bidirectional thrift client. More...

#include <thrift_asio_client.hpp>

Inheritance diagram for betabugs::networking::thrift_asio_client< ClientType, ProcessorType, HandlerInterfaceType >:

Public Member Functions

 thrift_asio_client (boost::asio::io_service &io_service, const std::string &host_name, const std::string &service_name)
 creates a thrift_asio_client and tries to connect to host_name:service_name
 
void update ()
 process incoming traffic
 
void connect_to (const std::string &host_name, const std::string service_name)
 close the connection and connect to host_name:service_name
 
void reconnect_in (const boost::posix_time::time_duration &duration)
 reconnect in seconds seconds
 

Protected Attributes

ClientType client_
 the client used to communicate with the server
 

Detailed Description

template<typename ClientType, typename ProcessorType, typename HandlerInterfaceType>
class betabugs::networking::thrift_asio_client< ClientType, ProcessorType, HandlerInterfaceType >

An asynchronous bidirectional thrift client.

Use this class as the base class for the implementation of your client side handler.

Template Parameters
ClientTypetype of the auto-generated client. i.e. MyAwesomeServerClient
ProcessorTypean auto-generated TProcessor, that works with HandlerInterfaceType. i.e. MyAwesomeClientProcessor
HandlerInterfaceTypeauto-generated interface of the handler you're implementing. i.e. MyAwesomeClientIf
Examples:
example_client.cpp.

The documentation for this class was generated from the following file: