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
  FileLikeSocket
  WSGIFuture
  _WorkItem
  WSGIExecutor
  FuturesMiddleware
Futures middleware that adds a Futures Executor to the environment
  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.
  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=None, max=-1, request_queue_size=5, timeout=10, shutdown_timeout=5)
A Cherrypy wsgiserver-compatible wrapper.
source code
 
get_method(method) source code
Variables [hide private]
  VERSION = '1.2.6'
  SERVER_NAME = 'giles-liveconsole3'
  SERVER_SOFTWARE = 'Rocket 1.2.6'
  HTTP_SERVER_SOFTWARE = 'Rocket 1.2.6 Python/2.7.5+'
  BUF_SIZE = 16384
  SOCKET_TIMEOUT = 10
  THREAD_STOP_CHECK_INTERVAL = 1
  IS_JYTHON = False
  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 = False
  has_futures = 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 = '%s %s\nContent-Length: %i\nContent-Type: %s\n\n%s\n'
  HTTP_METHODS = set(['OPTIONS', 'GET', 'HEAD', 'POST', 'PUT', '...
  NEWLINE = '\r\n'
  HEADER_RESPONSE = 'HTTP/1.1 %s\r\n%s'
  BASE_ENV = {'SCRIPT_NAME': '', 'SERVER_NAME': 'giles-liveconso...
  __package__ = 'gluon'
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.


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'

HTTP_METHODS

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

BASE_ENV

Value:
{'SCRIPT_NAME': '',
 'SERVER_NAME': 'giles-liveconsole3',
 'wsgi.errors': <epydoc.docintrospecter._DevNull instance at 0x20a6cb0\
>,
 'wsgi.file_wrapper': <class wsgiref.util.FileWrapper at 0x4452e20>,
 'wsgi.multiprocess': False,
 'wsgi.run_once': False,
 'wsgi.version': (1, 0)}