diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2011-06-22 16:51:40 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2011-06-22 16:51:40 +0200 |
commit | 12532c7940f23fcb3cd46208c141d47647e76231 (patch) | |
tree | 79600d31a8acb70e253bb5756a6c71dbf2332944 /src/pipe.hpp | |
parent | ec81f8fb2523e1e2fe45eaadc05311a35bf551d7 (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.hpp')
-rw-r--r-- | src/pipe.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
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_); |