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:
@@ -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_);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user