Permalink
Browse files

Merge branch 'master' into 0.9.0

  • Loading branch information...
2 parents 5ac075e + f28c17d commit 698e5f264ff79d5e9315a3bdb76ae3ea4392f773 @nathanmarz nathanmarz committed Dec 10, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/clj/backtype/storm/messaging/zmq.clj
View
6 src/clj/backtype/storm/messaging/zmq.clj
@@ -26,6 +26,8 @@
(defprotocol ZMQContextQuery
(zmq-context [this]))
+(def NOBLOCK-SNDMORE (bit-or ZMQ/SNDMORE ZMQ/NOBLOCK))
+
(deftype ZMQConnection [socket ^ByteBuffer bb]
Connection
(recv-with-flags [this flags]
@@ -37,8 +39,8 @@
(send [this task message]
(.clear bb)
(.putShort bb (short task))
- (mq/send socket (.array bb) ZMQ/SNDMORE)
- (mq/send socket message)) ;; TODO: temporarily remove the noblock flag
+ (mq/send socket (.array bb) NOBLOCK-SNDMORE)
+ (mq/send socket message ZMQ/NOBLOCK)) ;; TODO: how to do backpressure if doing noblock?... need to only unblock if the target disappears
(close [this]
(.close socket)
))

0 comments on commit 698e5f2

Please sign in to comment.