|
libtasks Documentation
1.6
|
#include <uwsgi_thrift_async_processor.h>


Public Types | |
| using | in_transport_type = uwsgi_thrift_transport< uwsgi_request > |
| using | out_transport_type = uwsgi_thrift_transport< http_response > |
| using | protocol_type = TBinaryProtocol |
Public Types inherited from tasks::event_task | |
| typedef std::function< void(worker *worker, const tasks_exception &e)> | error_func_worker_t |
| typedef std::function< void(const tasks_exception &e)> | error_func_void_t |
Public Types inherited from tasks::task | |
| typedef std::function< void(worker *worker)> | finish_func_worker_t |
| typedef std::function< void()> | finish_func_void_t |
Public Member Functions | |
| uwsgi_thrift_async_processor (net::socket &s) | |
| virtual | ~uwsgi_thrift_async_processor () |
| std::string | get_string () const |
| virtual bool | handle_request () |
| void | send_thrift_response () |
| Send the thrift response back to the caller. More... | |
| void | write_thrift_error (std::string msg, std::string service_name, boost::shared_ptr< protocol_type > out_protocol) |
Public Member Functions inherited from tasks::net::uwsgi_task | |
| uwsgi_task (net::socket &sock) | |
| virtual | ~uwsgi_task () |
| bool | handle_event (tasks::worker *worker, int revents) |
| uwsgi_request & | request () |
| const uwsgi_request & | request () const |
| uwsgi_request * | request_p () |
| const uwsgi_request * | request_p () const |
| http_response & | response () |
| const http_response & | response () const |
| http_response * | response_p () |
| const http_response * | response_p () const |
| void | send_response () |
| Send the resonse back. More... | |
Public Member Functions inherited from tasks::net_io_task | |
| net_io_task (int events) | |
| net_io_task (net::socket &socket, int events) | |
| virtual | ~net_io_task () |
| std::string | get_string () const |
| A debug helper. More... | |
| net::socket & | socket () |
| Provide access to the underlying socket object. More... | |
| const net::socket & | socket () const |
| Provide const access to the underlying socket object. More... | |
Public Member Functions inherited from tasks::io_task_base | |
| io_task_base (int events) | |
| virtual | ~io_task_base () |
| std::string | get_string () const |
| int | events () const |
| Return the monitored events. More... | |
| ev_io * | watcher () const |
| Return the io watcher object. More... | |
| virtual void | init_watcher () |
| Initialize the watcher. More... | |
| virtual void | start_watcher (worker *worker) |
| Start a watcher in the context of the given worker. More... | |
| virtual void | stop_watcher (worker *worker) |
| Stop a watcher in the context of the given worker. More... | |
| virtual void | update_watcher (worker *worker) |
| Udate a watcher in the context of the given worker. More... | |
| virtual void | dispose (worker *worker) |
| Stop the watcher before being deleted. More... | |
Public Member Functions inherited from tasks::event_task | |
| virtual | ~event_task () |
| worker * | assigned_worker () const |
| Returns a pointer to the assigned worker. More... | |
| void | assign_worker (worker *worker) |
| void | notify_error (worker *worker=nullptr) |
| void | on_error (error_func_worker_t f) |
| void | on_error (error_func_void_t f) |
| Install an error callback. More... | |
Public Member Functions inherited from tasks::task | |
| virtual | ~task () |
| bool | auto_delete () const |
| Returns true if auto deletion is active. More... | |
| void | disable_auto_delete () |
| Call this to deactivate auto deletion. More... | |
| void | finish (worker *worker=nullptr) |
| Called by a worker when a task has auto_deletion enabled. More... | |
| void | on_finish (finish_func_worker_t f) |
| void | on_finish (finish_func_void_t f) |
Public Member Functions inherited from tasks::error_base | |
| error_base () | |
| virtual | ~error_base () |
| bool | error () const |
| Return true if an error occured. More... | |
| tasks_error | error_code () const |
| Return the error code. More... | |
| const std::string & | error_message () const |
| Return the error message. More... | |
| int | sys_errno () const |
| Return the errno if available. More... | |
| std::string | sys_errno_str () const |
| Return the errno description if available. More... | |
| const tasks_exception & | exception () const |
| Return the underlying exception object. More... | |
| void | set_exception (tasks_exception &e) |
| Set an exception to report an error. More... | |
| void | reset_error () |
| Reset the error state. More... | |
Public Member Functions inherited from tasks::disposable | |
| disposable () | |
| virtual | ~disposable () |
| bool | can_dispose () const |
| Check if a task can be disposed or not. More... | |
| void | disable_dispose () |
| Mark a task for being not disposable. More... | |
| void | enable_dispose () |
| Mark a task for being disposable. More... | |
Private Attributes | |
| int32_t | m_seqid = 0 |
| std::unique_ptr< handler_type > | m_handler |
Additional Inherited Members | |
Static Public Member Functions inherited from tasks::net_io_task | |
| static void | add_task (net_io_task *task) |
Protected Member Functions inherited from tasks::net::uwsgi_task | |
| void | finish_request () |
| Called after a request has been responded. More... | |
Protected Member Functions inherited from tasks::net_io_task | |
| void | add_task (worker *worker, net_io_task *task) |
| io_base & | iob () |
| Grant socket access to the io_task_base. More... | |
| const io_base & | iob () const |
| Grant const socket access to the io_task_base. More... | |
| void | disable_auto_close () |
| Disable automatic closing of the socket in the desctructor. More... | |
Protected Member Functions inherited from tasks::io_task_base | |
| void | set_events (int events) |
| Update the events the object monitors. More... | |
Protected Attributes inherited from tasks::net::uwsgi_task | |
| uwsgi_request | m_request |
| http_response | m_response |
Definition at line 32 of file uwsgi_thrift_async_processor.h.
| using tasks::net::uwsgi_thrift_async_processor< handler_type >::in_transport_type = uwsgi_thrift_transport<uwsgi_request> |
Definition at line 34 of file uwsgi_thrift_async_processor.h.
| using tasks::net::uwsgi_thrift_async_processor< handler_type >::out_transport_type = uwsgi_thrift_transport<http_response> |
Definition at line 35 of file uwsgi_thrift_async_processor.h.
| using tasks::net::uwsgi_thrift_async_processor< handler_type >::protocol_type = TBinaryProtocol |
Definition at line 36 of file uwsgi_thrift_async_processor.h.
|
inline |
Definition at line 38 of file uwsgi_thrift_async_processor.h.
|
inlinevirtual |
Definition at line 40 of file uwsgi_thrift_async_processor.h.
|
inline |
Definition at line 42 of file uwsgi_thrift_async_processor.h.
|
inlinevirtual |
A uwsgi request handler needs to implement this. This method gets called after a uwsgi request has been deserialized successfully.
Implements tasks::net::uwsgi_task.
Definition at line 49 of file uwsgi_thrift_async_processor.h.

|
inline |
Send the thrift response back to the caller.
Definition at line 117 of file uwsgi_thrift_async_processor.h.
|
inline |
Write a thrift error into the protocol buffer.
| msg | The error message |
| service_name | The name of the thrift service |
| out_protocol | The outgoing protocol object |
Definition at line 127 of file uwsgi_thrift_async_processor.h.
|
private |
Definition at line 141 of file uwsgi_thrift_async_processor.h.
|
private |
Definition at line 140 of file uwsgi_thrift_async_processor.h.