Permalink
Browse files

Merge pull request #297 from devin-c/cleaner_ruby_rrbroker

Simplify the ruby req/rep broker example
  • Loading branch information...
2 parents b1d80ca + 746c82f commit 65f1843f2006c8cc93772c0923bdd166f6890884 @hintjens hintjens committed Feb 20, 2013
Showing with 4 additions and 12 deletions.
  1. +4 −12 examples/Ruby/rrbroker.rb
View
@@ -19,19 +19,11 @@
poller.poll(:blocking)
poller.readables.each do |socket|
if socket === frontend
- loop do
- socket.recv_string(message = '')
- more = socket.more_parts?
- backend.send_string(message, more ? ZMQ::SNDMORE : 0)
- break unless more
- end
+ socket.recv_strings(messages = [])
+ backend.send_strings(messages)
elsif socket === backend
- loop do
- socket.recv_string(message = '')
- more = socket.more_parts?
- frontend.send_string(message, more ? ZMQ::SNDMORE : 0)
- break unless more
- end
+ socket.recv_strings(messages = [])
+ frontend.send_strings(messages)
end
end
end

0 comments on commit 65f1843

Please sign in to comment.