summaryrefslogtreecommitdiff
path: root/src/xrep.hpp
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/xrep.hpp
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/xrep.hpp')
-rw-r--r--src/xrep.hpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/xrep.hpp b/src/xrep.hpp
index d5014e0..41c06b8 100644
--- a/src/xrep.hpp
+++ b/src/xrep.hpp
@@ -22,11 +22,11 @@
#define __ZMQ_XREP_HPP_INCLUDED__
#include <map>
-#include <vector>
#include "socket_base.hpp"
#include "stdint.hpp"
#include "msg.hpp"
+#include "fq.hpp"
namespace zmq
{
@@ -58,19 +58,8 @@ namespace zmq
private:
- struct inpipe_t
- {
- class pipe_t *pipe;
- uint32_t peer_id;
- bool active;
- };
-
- // Inbound pipes with the names of corresponging peers.
- typedef std::vector <inpipe_t> inpipes_t;
- inpipes_t inpipes;
-
- // The pipe we are currently reading from.
- inpipes_t::size_type current_in;
+ // Fair queueing object for inbound pipes.
+ fq_t fq;
// Have we prefetched a message.
bool prefetched;