Skip to content

Commit

Permalink
Merge pull request #144 from ggggggggg/issue142
Browse files Browse the repository at this point in the history
make send faster by calling get_events less often
  • Loading branch information
Keno authored Sep 1, 2017
2 parents cde187a + b5bc8bb commit b1ed616
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 @@ -450,7 +450,10 @@ function send(socket::Socket, zmsg::Message, SNDMORE::Bool=false)
wait(socket)
end
else
get_events(socket) != 0 && notify(socket)
notify_is_expensive = !isempty(socket.pollfd.notify.waitq)
if notify_is_expensive
get_events(socket) != 0 && notify(socket)
end
break
end
end
Expand Down Expand Up @@ -482,7 +485,10 @@ function recv(socket::Socket)
wait(socket)
end
else
get_events(socket) != 0 && notify(socket)
notify_is_expensive = !isempty(socket.pollfd.notify.waitq)
if notify_is_expensive
get_events(socket) != 0 && notify(socket)
end
break
end
end
Expand Down

0 comments on commit b1ed616

Please sign in to comment.