mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-29 20:59:47 +01:00
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>
This commit is contained in:
13
src/pipe.cpp
13
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)))
|
||||
|
||||
Reference in New Issue
Block a user