summaryrefslogtreecommitdiff
path: root/src/pipe.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-06-22 16:51:40 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-06-22 16:51:40 +0200
commit12532c7940f23fcb3cd46208c141d47647e76231 (patch)
tree79600d31a8acb70e253bb5756a6c71dbf2332944 /src/pipe.cpp
parentec81f8fb2523e1e2fe45eaadc05311a35bf551d7 (diff)
O(1) fair-queueing in XREP implemented
Up to now the complexity of fair-queueing in XREP was O(n). Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/pipe.cpp')
-rw-r--r--src/pipe.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/pipe.cpp b/src/pipe.cpp
index 1813ca0..c290bae 100644
--- a/src/pipe.cpp
+++ b/src/pipe.cpp
@@ -63,7 +63,8 @@ zmq::pipe_t::pipe_t (object_t *parent_, upipe_t *inpipe_, upipe_t *outpipe_,
peer (NULL),
sink (NULL),
state (active),
- delay (delay_)
+ delay (delay_),
+ pipe_id (0)
{
}
@@ -85,6 +86,16 @@ void zmq::pipe_t::set_event_sink (i_pipe_events *sink_)
sink = sink_;
}
+void zmq::pipe_t::set_pipe_id (uint32_t id_)
+{
+ pipe_id = id_;
+}
+
+uint32_t zmq::pipe_t::get_pipe_id ()
+{
+ return pipe_id;
+}
+
bool zmq::pipe_t::check_read ()
{
if (unlikely (!in_active || (state != active && state != pending)))