Skip to content

Commit

Permalink
call get_events less often in send and recv
Browse files Browse the repository at this point in the history
  • Loading branch information
ggggggggg committed Apr 14, 2017
1 parent 95445e7 commit 9bcc072
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ZMQ.jl
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,11 @@ function send(socket::Socket, zmsg::Message, SNDMORE::Bool=false)
wait(socket)
end
else
notify_is_expensive = !isempty(socket.pollfd.notify.waitq)
if notify_is_expensive
get_events(socket) != 0 && notify(socket)
break
end
break
end
end
end
Expand Down Expand Up @@ -530,8 +533,11 @@ function recv(socket::Socket)
wait(socket)
end
else
notify_is_expensive = !isempty(socket.pollfd.notify.waitq)
if notify_is_expensive
get_events(socket) != 0 && notify(socket)
break
end
break
end
end
return zmsg
Expand Down

0 comments on commit 9bcc072

Please sign in to comment.