Package cherrypy :: Class _Serving
[hide private]
[frames] | no frames]

Class _Serving

source code

   object --+    
            |    
thread._local --+
                |
               _Serving

An interface for registering request and response objects.

Rather than have a separate "thread local" object for the request and the response, this class works as a single threadlocal container for both objects (and any others which developers wish to define). In this way, we can easily dump those objects when we stop/start a new HTTP conversation, yet still refer to them as module-level globals in a thread-safe way.

Instance Methods [hide private]
 
load(self, request, response) source code
 
clear(self)
Remove all attributes of self.
source code

Inherited from thread._local: __delattr__, __getattribute__, __new__, __setattr__

Inherited from object: __format__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  request = _cprequest.Request(_httputil.Host("127.0.0.1", 80), ...
The request object for the current thread.
  response = _cprequest.Response()
The response object for the current thread.
Properties [hide private]

Inherited from object: __class__

Class Variable Details [hide private]

request

The request object for the current thread. In the main thread, and any threads which are not receiving HTTP requests, this is None.

Value:
_cprequest.Request(_httputil.Host("127.0.0.1", 80), _httputil.Host("12\
7.0.0.1", 1111))

response

The response object for the current thread. In the main thread, and any threads which are not receiving HTTP requests, this is None.

Value:
_cprequest.Response()