From 12532c7940f23fcb3cd46208c141d47647e76231 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Wed, 22 Jun 2011 16:51:40 +0200 Subject: 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 --- src/pipe.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/pipe.hpp') diff --git a/src/pipe.hpp b/src/pipe.hpp index d3bf866..df85bc2 100644 --- a/src/pipe.hpp +++ b/src/pipe.hpp @@ -25,6 +25,7 @@ #include "ypipe.hpp" #include "config.hpp" #include "object.hpp" +#include "stdint.hpp" #include "array.hpp" namespace zmq @@ -67,6 +68,10 @@ namespace zmq // Specifies the object to send events to. void set_event_sink (i_pipe_events *sink_); + // Pipe endpoint can store an opaque ID to be used by its clients. + void set_pipe_id (uint32_t id_); + uint32_t get_pipe_id (); + // Returns true if there is at least one message to read in the pipe. bool check_read (); @@ -176,6 +181,9 @@ namespace zmq // asks us to. bool delay; + // Opaque ID. To be used by the clients, not the pipe itself. + uint32_t pipe_id; + // Returns true if the message is delimiter; false otherwise. static bool is_delimiter (msg_t &msg_); -- cgit v1.2.3