Kyoto Tycoon

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
kyototycoon::RPCServer::Worker Class Reference

Interface to process each request. More...

`#include <ktrpc.h>`

List of all members.

## Public Member Functions
virtual | ~Worker ()
| Destructor.
virtual RPCClient::ReturnValue | process (RPCServer *serv, Session *sess, const std::string &name, const std::map< std::string, std::string > &inmap, std::map< std::string, std::string > &outmap)=0
| Process each request of RPC.
virtual int32_t | process (HTTPServer *serv, HTTPServer::Session *sess, const std::string &path, HTTPClient::Method method, const std::map< std::string, std::string > &reqheads, const std::string &reqbody, std::map< std::string, std::string > &resheads, std::string &resbody, const std::map< std::string, std::string > &misc)
| Process each request of the others.
virtual bool | process_binary (ThreadedServer *serv, ThreadedServer::Session *sess)
| Process each binary request.
virtual void | process_idle (RPCServer *serv)
| Process each idle event.
virtual void | process_timer (RPCServer *serv)
| Process each timer event.
virtual void | process_start (RPCServer *serv)
| Process the starting event.
virtual void | process_finish (RPCServer *serv)
| Process the finishing event.

## Detailed Description

Interface to process each request.

## Constructor & Destructor Documentation

virtual kyototycoon::RPCServer::Worker::~Worker | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

virtual RPCClient::ReturnValue kyototycoon::RPCServer::Worker::process | ( | RPCServer * | serv,
|  | Session * | sess,
|  | const std::string & | name,
|  | const std::map< std::string, std::string > & | inmap,
|  | std::map< std::string, std::string > & | outmap
| ) |  | `[pure virtual]`

Process each request of RPC.

Parameters:

  serv | the server.
  sess | the session with the client.
  name | the name of the procecude.
  inmap | a string map which contains the input of the procedure.
  outmap | a string map to contain the input parameters.

Returns:
  the return value of the procedure.

virtual int32_t kyototycoon::RPCServer::Worker::process | ( | HTTPServer * | serv,
|  | HTTPServer::Session * | sess,
|  | const std::string & | path,
|  | HTTPClient::Method | method,
|  | const std::map< std::string, std::string > & | reqheads,
|  | const std::string & | reqbody,
|  | std::map< std::string, std::string > & | resheads,
|  | std::string & | resbody,
|  | const std::map< std::string, std::string > & | misc
| ) |  | `[virtual]`

Process each request of the others.

Parameters:

  serv | the server.
  sess | the session with the client.
  path | the path of the requested resource.
  method | the kind of the request methods.
  reqheads | a string map which contains the headers of the request. Header names are converted into lower cases. The empty key means the request-line.
  reqbody | a string which contains the entity body of the request.
  resheads | a string map to contain the headers of the response.
  resbody | a string to contain the entity body of the response.
  misc | a string map which contains miscellaneous information. "url" means the absolute URL. "query" means the query string of the URL.

Returns:
  the status code of the response. If it is less than 1, internal server error is sent to the client and the connection is closed.

virtual bool kyototycoon::RPCServer::Worker::process_binary | ( | ThreadedServer * | serv,
|  | ThreadedServer::Session * | sess
| ) |  | `[virtual]`

Process each binary request.

Parameters:

  serv | the server.
  sess | the session with the client.

Returns:
  true to reuse the session, or false to close the session.

virtual void kyototycoon::RPCServer::Worker::process_idle | ( | RPCServer * | serv | ) | `[virtual]`

Process each idle event.

Parameters:

  serv | the server.

virtual void kyototycoon::RPCServer::Worker::process_timer | ( | RPCServer * | serv | ) | `[virtual]`

Process each timer event.

Parameters:

  serv | the server.

virtual void kyototycoon::RPCServer::Worker::process_start | ( | RPCServer * | serv | ) | `[virtual]`

Process the starting event.

Parameters:

  serv | the server.

virtual void kyototycoon::RPCServer::Worker::process_finish | ( | RPCServer * | serv | ) | `[virtual]`

Process the finishing event.

Parameters:

  serv | the server.