Design wise and performance wise which approach is recommended for handling multiple Zeromq sockets and why ?
Is it true that Tornado’s IOLoop used by ZeroMQ hogs less CPU than the Poller used in a while loop for handling multiple sockets ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It would be nice if you add your own observation / analysis to your question.
I don’t think there is any difference in performance but there is a difference in design.
In case of poller
You register your sockets to be polled and then you use
if blocksto identify and work with each socket.In case of eventloop
But using event loop is quite elegant when you are handling multiple sockets since you
register callbacks.As you can notice from the second example, the if blocks are removed. You write your socket messaging operation else where and you register your callback methods when socket is ready.
In this case on_recv()I hope that clarifies your question.