#1085: CherryPyWSGIServer not application tickable
-----------------------------------+----------------------------------------
Reporter:
kris...@ccpgames.com | Owner: fumanchu
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: wsgiserver | Keywords:
-----------------------------------+----------------------------------------
Embedding CherryPyWSGIServer in a host application is not entirely
straightforward. It contains a method, start() which performs two things:
1) it binds and sets up the connection
2) it runs an endless loop accepting connections.
This makes it impossible to decouple the two, for example, in order to do
a server.tick() as a part of a larger main loop of an application. One
can certainly do one's own tick() calls from other worker threads, but the
thread that called start() is stuck in its internal loop until the server
ends().
It would be preferable to factor the start() function into a setup() and
serve():
def start(self):
self.setup()
self.serve()
This would allow an embedding application to call server.setup() and then
server.tick() from its main loop as it pleases.
--
Ticket URL: <
http://www.cherrypy.org/ticket/1085>
CherryPy <
http://www.cherrypy.org>
CherryPy - a pythonic, object-oriented HTTP framework