Skip to content

Commit

Permalink
Make pops public interface of ConsumerTable
Browse files Browse the repository at this point in the history
  • Loading branch information
qiluo-msft committed Sep 18, 2017
1 parent d4adb72 commit 9d8fa4b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions common/consumerstatetable.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ class ConsumerStateTable : public RedisTransactioner, public RedisSelect, public
/* If there is nothing to pop, the output paramter will have empty key and op */
void pop(KeyOpFieldsValuesTuple &kco, std::string prefix = EMPTY_PREFIX);

private:
std::deque<KeyOpFieldsValuesTuple> m_buffer;

/* Get multiple pop elements */
void pops(std::deque<KeyOpFieldsValuesTuple> &vkco, std::string prefix = EMPTY_PREFIX);

private:
std::deque<KeyOpFieldsValuesTuple> m_buffer;
};

}
5 changes: 2 additions & 3 deletions common/consumertable.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ class ConsumerTable : public RedisTransactioner, public RedisSelect, public Tabl
/* Get a singlesubscribe channel rpop */
void pop(KeyOpFieldsValuesTuple &kco, std::string prefix = EMPTY_PREFIX);

private:
std::deque<KeyOpFieldsValuesTuple> m_buffer;

/* Get multiple pop elements */
void pops(std::deque<KeyOpFieldsValuesTuple> &vkco, std::string prefix = EMPTY_PREFIX);
private:
std::deque<KeyOpFieldsValuesTuple> m_buffer;
};

}
Expand Down
4 changes: 4 additions & 0 deletions common/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <queue>
#include <tuple>
#include <map>
#include <deque>
#include "hiredis/hiredis.h"
#include "dbconnector.h"
#include "redisreply.h"
Expand Down Expand Up @@ -68,6 +69,9 @@ class TableEntryPoppable {

/* Pop an action (set or del) on the table */
virtual void pop(KeyOpFieldsValuesTuple &kco, std::string prefix = EMPTY_PREFIX) = 0;

/* Get multiple pop elements */
virtual void pops(std::deque<KeyOpFieldsValuesTuple> &vkco, std::string prefix = EMPTY_PREFIX) = 0;
};

class TableEntryEnumerable {
Expand Down

0 comments on commit 9d8fa4b

Please sign in to comment.