Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make pops public interface of ConsumerTable #123

Merged
merged 1 commit into from
Sep 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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