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 = <cherrypy._cprequest.Request object>
The request object for the current thread.
  response = <cherrypy._cprequest.Response object>
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:
<cherrypy._cprequest.Request object>

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:
<cherrypy._cprequest.Response object>