| 3801 | """ Untested. """ |
| 3802 | |
| 3803 | def run(self, handler): |
| 3804 | from twisted.web import server, wsgi |
| 3805 | from twisted.python.threadpool import ThreadPool |
| 3806 | from twisted.internet import reactor |
| 3807 | thread_pool = ThreadPool() |
| 3808 | thread_pool.start() |
| 3809 | reactor.addSystemEventTrigger('after', 'shutdown', thread_pool.stop) |
| 3810 | factory = server.Site(wsgi.WSGIResource(reactor, thread_pool, handler)) |
| 3811 | reactor.listenTCP(self.port, factory, interface=self.host) |
| 3812 | if not reactor.running: |
| 3813 | reactor.run() |
| 3814 | |
| 3815 | |
| 3816 | class DieselServer(ServerAdapter): |