commit 2104e96a66ed2a7fc2ac36a24b421d92d58a928a parent 107cfc058de3d0f2d76468ff4b87166f1a09d386 Author: ThomasV <thomasv@gitorious> Date: Tue, 19 May 2015 10:22:25 +0200 network: use get_nowait on one of the two queues Diffstat:
M | lib/network.py | | | 11 | ++++++----- |
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/lib/network.py b/lib/network.py @@ -430,11 +430,12 @@ class Network(util.DaemonThread): self.response_queue.put(response) def handle_requests(self): - try: - request = self.requests_queue.get(timeout=0.1) - except Queue.Empty: - return - self.process_request(request) + while True: + try: + request = self.requests_queue.get_nowait() + except Queue.Empty: + break + self.process_request(request) def process_request(self, request): method = request['method']