Issue #1085 new

CherryPyWSGIServer not application tickable

Anonymous created an issue

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.

Reported by kristjan@ccpgames.com

Comments (1)

  1. Log in to comment