bug-fixes in messaging
This commit is contained in:
parent
e3ed6868f4
commit
6d6c29f7b5
@ -50,12 +50,13 @@ class MqClient(object):
|
||||
def connect(self):
|
||||
if not self._connected:
|
||||
promise = self._client.connect()
|
||||
self._client.wait(promise, timeout=10000)
|
||||
self._connected = True
|
||||
if self._client.wait(promise, timeout=10) is not None:
|
||||
self._connected = True
|
||||
|
||||
def close(self):
|
||||
if self._connected:
|
||||
self._client.close()
|
||||
promise = self._client.close()
|
||||
self._client.wait(promise)
|
||||
self._connected = False
|
||||
|
||||
def declare(self, queue, exchange=None):
|
||||
|
@ -39,5 +39,7 @@ class Subscription(object):
|
||||
raise RuntimeError(
|
||||
"Subscription object must be used within 'with' block")
|
||||
msg_handle = self._client.wait(self._promise, timeout=timeout)
|
||||
if msg_handle is None:
|
||||
return None
|
||||
msg = Message(self._client, msg_handle)
|
||||
return msg
|
||||
|
@ -2,4 +2,4 @@ d2to1>=0.2.10,<0.3
|
||||
pbr>=0.5,<0.6
|
||||
anyjson
|
||||
eventlet>=0.9.12
|
||||
https://github.com/istalker2/puka/releases/download/1.0.7b/puka-1.0.7b.tar.gz#egg=puka-1.0.7b
|
||||
https://github.com/istalker2/puka/releases/download/1.0.7c/puka-1.0.7c.tar.gz#egg=puka-1.0.7c
|
Loading…
x
Reference in New Issue
Block a user