Package web2py :: Package gluon :: Module rocket
[hide private]
[frames] | no frames]

Module rocket

source code

Classes [hide private]
  NullHandler
A Logging handler to prevent library errors.
  Connection
  Listener
The Listener class is a class responsible for accepting connections and queuing them to be processed by a worker thread.
  Rocket
The Rocket class is responsible for handling threads and accepting and dispatching connections.
  Monitor
  ThreadPool
The ThreadPool class is a container class for all the worker threads.
  SSLError
  Headers
  FileWrapper
Wrapper to convert file-like objects to iterables
  Worker
The Worker class is a base class responsible for receiving connections and (a subclass) will run an application to process the the connection
  SocketTimeout
Exception for when a socket times out between requests.
  BadRequest
Exception for when a client sends an incomprehensible request.
  SocketClosed
Exception for when a socket is closed by the client.
  ChunkedReader
  WSGIWorker
Functions [hide private]
 
b(val)
Convert string/unicode/bytes literals into bytes.
source code
 
u(val, encoding='us-ascii')
Convert bytes into string/unicode.
source code
 
CherryPyWSGIServer(bind_addr, wsgi_app, numthreads=10, server_name=1, max=-1, request_queue_size=5, timeout=10, shutdown_timeout=5)
A Cherrypy wsgiserver-compatible wrapper.
source code
 
_formatparam(param, value=1, quote=1)
Convenience function to format and return a key=value pair.
source code
 
get_method(method) source code
 
demo_app(environ, start_response) source code
 
demo() source code
Variables [hide private]
  VERSION = '1.2.2'
  SERVER_NAME = 'www'
  SERVER_SOFTWARE = 'Rocket 1.2.2'
  HTTP_SERVER_SOFTWARE = 'Rocket 1.2.2 Python/2.5.2'
  BUF_SIZE = 16384
  SOCKET_TIMEOUT = 1
PyMySQL: A pure-Python drop-in replacement for MySQLdb.
  THREAD_STOP_CHECK_INTERVAL = 1
PyMySQL: A pure-Python drop-in replacement for MySQLdb.
  IS_JYTHON = True
  IGNORE_ERRORS_ON_CLOSE = set([103, 104])
  DEFAULT_LISTEN_QUEUE_SIZE = 5
  DEFAULT_MIN_THREADS = 10
  DEFAULT_MAX_THREADS = 0
  DEFAULTS = {'LISTEN_QUEUE_SIZE': 5, 'MAX_THREADS': 0, 'MIN_THR...
  PY3K = True
  has_ssl = True
  log = logging.getLogger('Rocket.Errors.ThreadPool')
  re_SLASH = re.compile(r'(?i)%2F')
  re_REQUEST_LINE = re.compile(r'(?x)^(?P<method>OPTIONS|GET|HEA...
  LOG_LINE = '%(client_ip)s - "%(request_line)s" - %(status)s %(...
  RESPONSE = 'HTTP/1.1 %s\nContent-Length: %i\nContent-Type: %s\...
  HTTP_METHODS = set(['OPTIONS', 'GET', 'HEAD', 'POST', 'PUT', '...
  _tspecials = re.compile(r'[ \(\)<>@,;:\\"/\[\]\?=]')
  NEWLINE = '\r\n'
  HEADER_RESPONSE = 'HTTP/1.1 %s\r\n%s'
  BASE_ENV = {'SCRIPT_NAME': '', 'SERVER_NAME': 'www', 'wsgi.err...
Function Details [hide private]

b(val)

source code 
Convert string/unicode/bytes literals into bytes. This allows for the same code to run on Python 2.x and 3.x.

u(val, encoding='us-ascii')

source code 
Convert bytes into string/unicode. This allows for the same code to run on Python 2.x and 3.x.

_formatparam(param, value=1, quote=1)

source code 

Convenience function to format and return a key=value pair.

This will quote the value if needed or if quote is true.

Variables Details [hide private]

DEFAULTS

Value:
{'LISTEN_QUEUE_SIZE': 5, 'MAX_THREADS': 0, 'MIN_THREADS': 10}

re_REQUEST_LINE

Value:
re.compile(r'(?x)^(?P<method>OPTIONS|GET|HEAD|POST|PUT|DELETE|TRACE|CO\
NNECT) ((?P<scheme>[^:/]+)(://)(?P<host>[^/]+))?(?P<path>(\*|/[^ \?]*)\
)(\?(?P<query_string>[^ ]+))? (?P<protocol>HTTPS?/1\.[01])$')

LOG_LINE

Value:
'%(client_ip)s - "%(request_line)s" - %(status)s %(size)s'

RESPONSE

Value:
'''HTTP/1.1 %s
Content-Length: %i
Content-Type: %s

%s
'''

HTTP_METHODS

Value:
set(['OPTIONS', 'GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'TRACE', 'CONN\
ECT'])

BASE_ENV

Value:
{'SCRIPT_NAME': '',
 'SERVER_NAME': 'www',
 'wsgi.errors': <epydoc.docintrospecter._DevNull instance at 0x2b630b3\
2a440>,
 'wsgi.file_wrapper': <class web2py.gluon.rocket.FileWrapper at 0x13da\
350>,
 'wsgi.multiprocess': False,
 'wsgi.run_once': False,
...