summaryrefslogtreecommitdiff
path: root/src/sub.hpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@fastmq.commkdir>2009-12-15 09:09:19 +0100
committerMartin Sustrik <sustrik@fastmq.commkdir>2009-12-15 09:09:19 +0100
commite49115224a7957b0e5d49326bc02ae6af186eaf9 (patch)
tree81d1ca0ea496004bbc85cec9b3289af96cdaa197 /src/sub.hpp
parentbd792faa9d6c78c375dbc52c6d773e157335da36 (diff)
zmq_encoder/decoder are able to add/trim prefixes from messages; fair queueing and load balancing algorithms factorised into separate classes
Diffstat (limited to 'src/sub.hpp')
-rw-r--r--src/sub.hpp21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/sub.hpp b/src/sub.hpp
index 8ad8a18..1eafdac 100644
--- a/src/sub.hpp
+++ b/src/sub.hpp
@@ -24,7 +24,7 @@
#include <string>
#include "socket_base.hpp"
-#include "yarray.hpp"
+#include "fq.hpp"
namespace zmq
{
@@ -53,26 +53,15 @@ namespace zmq
private:
- // Helper function to return one message choosed using
- // fair queueing algorithm.
- int fq (zmq_msg_t *msg_, int flags_);
-
- // Inbound pipes, i.e. those the socket is getting messages from.
- typedef yarray_t <class reader_t> in_pipes_t;
- in_pipes_t in_pipes;
-
- // Number of active inbound pipes. Active pipes are stored in the
- // initial section of the in_pipes array.
- in_pipes_t::size_type active;
-
- // Index of the next inbound pipe to read messages from.
- in_pipes_t::size_type current;
+ // Fair queueing object for inbound pipes.
+ fq_t fq;
// Number of active "*" subscriptions.
int all_count;
- // List of all prefix subscriptions.
typedef std::multiset <std::string> subscriptions_t;
+
+ // List of all prefix subscriptions.
subscriptions_t prefixes;
// List of all exact match subscriptions.