From 1c2af3131483002f35f3fc75244889e79c346b37 Mon Sep 17 00:00:00 2001 From: Brendan Howell Date: Fri, 28 Apr 2017 23:14:30 +0200 Subject: [PATCH] a little experiment with zmq polling2 --- screenless/bureau/bureau.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/screenless/bureau/bureau.py b/screenless/bureau/bureau.py index 3d701fb..b8a8c13 100644 --- a/screenless/bureau/bureau.py +++ b/screenless/bureau/bureau.py @@ -312,13 +312,12 @@ class Bureau(object): poller.register(self._recv, zmq.POLLIN) while True: - try: - msgs = dict(poller.poll(500)) - if msgs: - if msgs.get(self._recv) == zmq.POLLIN: - msg = self._recv.recv_string(flags=zmq.NOBLOCK) - else: - continue + msgs = dict(poller.poll(500)) + if msgs: + if msgs.get(self._recv) == zmq.POLLIN: + msg = self._recv.recv_string(flags=zmq.NOBLOCK) + else: + continue # msg = self._recv.recv_string(flags=zmq.NOBLOCK) #except zmq.ZMQError: # time.sleep(0.05) # don't waste CPU