Package cherrypy :: Package process :: Module servers :: Class ServerAdapter
[hide private]
[frames] | no frames]

Class ServerAdapter

source code

object --+
         |
        ServerAdapter
Known Subclasses:

Adapter for an HTTP server.

If you need to start more than one HTTP server (to serve on multiple
ports, or protocols, etc.), you can manually register each one and then
start them all with bus.start:

    s1 = ServerAdapter(bus, MyWSGIServer(host='0.0.0.0', port=80))
    s2 = ServerAdapter(bus, another.HTTPServer(host='127.0.0.1', SSL=True))
    s1.subscribe()
    s2.subscribe()
    bus.start()

Instance Methods [hide private]
 
__init__(self, bus, httpserver=None, bind_addr=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
subscribe(self) source code
 
unsubscribe(self) source code
 
start(self)
Start the HTTP server.
source code
 
_get_base(self) source code
 
_start_http_thread(self)
HTTP servers MUST be running in new threads, so that the main thread persists to receive KeyboardInterrupt's.
source code
 
wait(self)
Wait until the HTTP server is ready to receive requests.
source code
 
stop(self)
Stop the HTTP server.
source code
 
restart(self)
Restart the HTTP server.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, bus, httpserver=None, bind_addr=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

_start_http_thread(self)

source code 

HTTP servers MUST be running in new threads, so that the main thread persists to receive KeyboardInterrupt's. If an exception is raised in the httpserver's thread then it's trapped here, and the bus (and therefore our httpserver) are shut down.