diff options
Diffstat (limited to 'src/io_thread.cpp')
-rw-r--r-- | src/io_thread.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/io_thread.cpp b/src/io_thread.cpp index b38f58c..92c314a 100644 --- a/src/io_thread.cpp +++ b/src/io_thread.cpp @@ -22,10 +22,8 @@ #include "../include/zmq.h" #include "io_thread.hpp" -#include "command.hpp" #include "platform.hpp" #include "err.hpp" -#include "command.hpp" #include "dispatcher.hpp" zmq::io_thread_t::io_thread_t (dispatcher_t *dispatcher_, @@ -67,17 +65,18 @@ int zmq::io_thread_t::get_load () void zmq::io_thread_t::in_event () { + // TODO: Do we want to limit number of commands I/O thread can + // process in a single go? + while (true) { - // Get the next signal. - uint32_t signal = signaler.check (); - if (signal == signaler_t::no_signal) + // Get the next command. If there is none, exit. + command_t cmd; + if (!signaler.recv (&cmd, false)) break; - // Process all the commands from the thread that sent the signal. - command_t cmd; - while (get_dispatcher ()->read (signal, get_thread_slot (), &cmd)) - cmd.destination->process_command (cmd); + // Process the command. + cmd.destination->process_command (cmd); } } |