gar1t/erlang-czmq — pull request #21 by artemav (2014-07-24 13:44:48+00:00)
Title: The polling inside of czmq port

The current polling way `czmq_poller.erl` is inefficient right now. I tried to resolve this flaw by adding a new ability to create a poller on the port side and receive messages from a socket asynchronously.
I replaced simple inner loop with _event loop_ thus each command coming from the erlang is an event. If a command of creation a new poller is occured than the port adds new [timer](http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#code_ev_timer_code_relative_and_opti) to the _event loop_. The timer checks a socket for the presence of a 'hot' frame, pulls the frame and sends it to the erlang. The `czmq.erl` services as a proxy: receives the port answers, frames and forwards them to the clients.