- request = self.server.requests.get(block=False, timeout=1)
+ request = self.server.requests.get() #(block=False, timeout=1)
response = self.server.wsgi_app(request.environ,
- # write the response into the buffer
except (KeyboardInterrupt, SystemExit):
def stop(self, callingThread=None):
"""Gracefully shutdown a server that is serving forever."""
+ # insert a bunch of None requests that signal
+ # the threads to shut down
+ for i in range(0, len(self._workerThreads)):
# Must shut down threads here so the code that calls
# this method can know when all threads are stopped.
for worker in self._workerThreads:
- if worker is not callingThread:
+ if worker is not callingThread: