From c70b2dc0ec338ffd7ca5f4c8146b9975ef8e33bb Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 30 Nov 2012 22:08:59 +0100 Subject: [PATCH] Add libzmq 3.2.x compatibility. pyzmq compiled with zeromq-3.2 does not have HWM socket opt. Instead of this, exists SNDHWM that replaces it. --- kombu/transport/zmq.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kombu/transport/zmq.py b/kombu/transport/zmq.py index e089ba49..5d5a7600 100644 --- a/kombu/transport/zmq.py +++ b/kombu/transport/zmq.py @@ -111,7 +111,12 @@ class Client(object): self.sink = None self.vent = self.context.socket(zmq.PUSH) - self.vent.setsockopt(zmq.HWM, hwm) + + if hasattr(zmq, 'SNDHWM'): + self.vent.setsockopt(zmq.SNDHWM, hwm) + else: + self.vent.setsockopt(zmq.HWM, hwm) + if swap_size: self.vent.setsockopt(zmq.SWAP, swap_size)