|
@ -1,9 +1,8 @@ |
|
|
import time |
|
|
|
|
|
import pickle |
|
|
import pickle |
|
|
import re |
|
|
import re |
|
|
|
|
|
|
|
|
try: |
|
|
try: |
|
|
import zmq |
|
|
import eventlet.green.zmq as zmq |
|
|
except ImportError: |
|
|
except ImportError: |
|
|
zmq = None |
|
|
zmq = None |
|
|
|
|
|
|
|
@ -92,12 +91,9 @@ class ZmqManager(PubSubManager): # pragma: no cover |
|
|
|
|
|
|
|
|
def zmq_listen(self): |
|
|
def zmq_listen(self): |
|
|
while True: |
|
|
while True: |
|
|
try: |
|
|
response = self.sub.recv() |
|
|
response = self.sub.recv(flags=zmq.NOBLOCK) |
|
|
if response is not None: |
|
|
if response is not None: |
|
|
yield response |
|
|
yield response |
|
|
|
|
|
except zmq.Again: |
|
|
|
|
|
time.sleep(0.5) |
|
|
|
|
|
|
|
|
|
|
|
def _listen(self): |
|
|
def _listen(self): |
|
|
for message in self.zmq_listen(): |
|
|
for message in self.zmq_listen(): |
|
|