Permalink
Browse files

Merge pull request #36 from timdoug/diesel2

zeromq additions
  • Loading branch information...
2 parents 782eee2 + 3933b53 commit 79c27eb6caccf91314fee935cdad0114fb5ed46a Jamie Turner committed May 8, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 diesel/protocols/zeromq.py
@@ -31,11 +31,11 @@ def __init__(self, socket, bind=None, connect=None, linger_time=1000):
self.handle_transition()
self.destroyed = False
- def send(self, message):
+ def send(self, message, flags=0):
while True:
self.write_gate.wait()
try:
- self.socket.send(message, zmq.NOBLOCK)
+ self.socket.send(message, zmq.NOBLOCK | flags)
except zmq.ZMQError, e:
if e.errno == EAGAIN:
self.handle_transition() # force re-evaluation of EVENTS
@@ -44,11 +44,11 @@ def send(self, message):
else:
break
- def recv(self):
+ def recv(self, copy=True):
while True:
self.read_gate.wait()
try:
- m = self.socket.recv(zmq.NOBLOCK)
+ m = self.socket.recv(zmq.NOBLOCK, copy=copy)
except zmq.ZMQError, e:
if e.errno == EAGAIN:
self.handle_transition() # force re-evaluation of EVENTS

0 comments on commit 79c27eb

Please sign in to comment.