Package tangled :: Module server :: Class AsyncHTTPRequestHandler
[hide private]
[frames] | no frames]

Class AsyncHTTPRequestHandler

source code

                asyncore.dispatcher --+    
                                      |    
                    asynchat.async_chat --+
                                          |
SocketServer.BaseRequestHandler --+       |
                                  |       |
  SocketServer.StreamRequestHandler --+   |
                                      |   |
  BaseHTTPServer.BaseHTTPRequestHandler --+
                                          |
                                         AsyncHTTPRequestHandler

An asynchronous HTTP request handler inspired somewhat by the http://code.activestate.com/recipes/440665-asynchronous-http-server/ recipe.

Nested Classes [hide private]
  Pusher

Inherited from BaseHTTPServer.BaseHTTPRequestHandler: MessageClass

Instance Methods [hide private]
 
__init__(self, conn, addr, server) source code
 
collect_incoming_data(self, data) source code
 
create_rfile(self) source code
 
prepare_request(self)
Prepare for reading the request body
source code
 
handle_junk(self) source code
 
handle_request_data(self)
Called when a request body has been read
source code
 
finish_request(self, response)
Called with the request handler's response
source code
 
handle_request(self)
Dispatch the request to a handler
source code
 
handle_request_line(self)
Called when the http request line and headers have been received
source code
 
log_message(self, format, *args)
Log an arbitrary message.
source code
 
request_handled(self, response) source code
 
request_error(self, error) source code

Inherited from asynchat.async_chat: close_when_done, discard_buffers, found_terminator, get_terminator, handle_close, handle_read, handle_write, initiate_send, push, push_with_producer, readable, set_terminator, writable

Inherited from asynchat.async_chat (private): _collect_incoming_data, _get_data

Inherited from asyncore.dispatcher: __getattr__, __repr__, accept, add_channel, bind, close, connect, create_socket, del_channel, handle_accept, handle_connect, handle_connect_event, handle_error, handle_expt, handle_expt_event, handle_read_event, handle_write_event, listen, log, log_info, recv, send, set_reuse_addr, set_socket

Inherited from BaseHTTPServer.BaseHTTPRequestHandler: address_string, date_time_string, end_headers, handle, handle_one_request, log_date_time_string, log_error, log_request, parse_request, send_error, send_header, send_response, version_string

Inherited from SocketServer.StreamRequestHandler: finish, setup

Class Variables [hide private]
  server_version = 'Tangled/0.1.1.1'
  methods = ['HEAD', 'GET', 'POST', 'PUT', 'DELETE', 'TRACE', 'O...

Inherited from asynchat.async_chat: ac_in_buffer_size, ac_out_buffer_size

Inherited from asyncore.dispatcher: accepting, addr, closing, connected, debug, ignore_log_types

Inherited from BaseHTTPServer.BaseHTTPRequestHandler: default_request_version, error_content_type, error_message_format, monthname, protocol_version, responses, sys_version, weekdayname

Inherited from SocketServer.StreamRequestHandler: rbufsize, wbufsize

Method Details [hide private]

__init__(self, conn, addr, server)
(Constructor)

source code 
Overrides: SocketServer.BaseRequestHandler.__init__

collect_incoming_data(self, data)

source code 
Overrides: asynchat.async_chat.collect_incoming_data

finish_request(self, response)

source code 

Called with the request handler's response

Parameters:
  • response (Response) - The response to the request

log_message(self, format, *args)

source code 

Log an arbitrary message.

This is used by all other logging functions. Override it if you have specific logging wishes.

The first argument, FORMAT, is a format string for the message to be logged. If the format string contains any % escapes requiring parameters, they should be specified as subsequent arguments (it's just like printf!).

The client host and current date/time are prefixed to every message.

Overrides: BaseHTTPServer.BaseHTTPRequestHandler.log_message
(inherited documentation)

Class Variable Details [hide private]

methods

Value:
['HEAD',
 'GET',
 'POST',
 'PUT',
 'DELETE',
 'TRACE',
 'OPTIONS',
 'CONNECT',
...