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
| FileLikeSocket
| Future
| ThreadPoolExecutor
| 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.
| SSLError
| 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
| LimitingFileWrapper
| FileSystemWorker
| 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=global_settings.applications_parent, max=-1, request_queue_size=5, timeout=10, shutdown_timeout=5) A Cherrypy wsgiserver-compatible wrapper. | source code

get_method(method) | source code

demo_app(environ, start_response) | source code

demo() | source code

Variables | [hide private]

| VERSION = ``'``1.2.4``'``
| SERVER_NAME = ``'``www``'``
| SERVER_SOFTWARE = ``'``Rocket 1.2.4``'``
| HTTP_SERVER_SOFTWARE = ``'``Rocket 1.2.4 Python/2.5.2``'``
| BUF_SIZE = `16384`
| SOCKET_TIMEOUT = `<web2py.gluon.custom_import._Web2pyImporter o`...`` PyMySQL: A pure-Python drop-in replacement for MySQLdb.
| THREAD_STOP_CHECK_INTERVAL = `<web2py.gluon.custom_import._Web2`...`` 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_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 = ``'``HTTP/1.1 %s\nContent-Length: %i\nContent-Type: %s\``...``
| HTTP_METHODS = `set(['OPTIONS', 'GET', 'HEAD', 'POST', 'PUT', '`...``
| CHUNK_SIZE = `65536`
| INDEX_HEADER = ``'``<html>\n<head><title>Directory Index: %(path)s``...``
| INDEX_ROW = ``'``<tr><td><div class="%(cls)s"><a href="/%(link)s">``...``
| INDEX_FOOTER = ``'``</table></body></html>\r\n``'``
| 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.

Variables Details | [hide private]

### SOCKET_TIMEOUT

PyMySQL: A pure-Python drop-in replacement for MySQLdb.

Copyright (c) 2010 PyMySQL contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Value:

      global_settings.applications_parent

### THREAD_STOP_CHECK_INTERVAL

PyMySQL: A pure-Python drop-in replacement for MySQLdb.

Copyright (c) 2010 PyMySQL contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Value:

      global_settings.applications_parent

### 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'])

### INDEX_HEADER

Value:

      '''<html>
      <head><title>Directory Index: %(path)s</title>
      <style> .parent { margin-bottom: 1em; }</style>
      </head>
      <body><h1>Directory Index: %(path)s</h1>
      <table>
      <tr><th>Directories</th></tr>
      '''

### INDEX_ROW

Value:

      '<tr><td><div class="%(cls)s"><a href="/%(link)s">%(name)s</a></div></
      td></tr>'

### BASE_ENV

Value:

      {'SCRIPT_NAME': '',
       'SERVER_NAME': 'www',
       'wsgi.errors': <epydoc.docintrospecter._DevNull instance at 0x2af5fa8
      c2440>,
       'wsgi.file_wrapper': <class wsgiref.util.FileWrapper at 0x1452410>,
       'wsgi.multiprocess': False,
       'wsgi.run_once': False,
       'wsgi.version': (1, 0)}