(cobra client and bots) add batch_size subscription option for retrieving multiple messages at once

This commit is contained in:
Benjamin Sergeant
2020-06-17 17:13:45 -07:00
parent bf0f11fd65
commit 565a08b229
9 changed files with 18 additions and 2 deletions

View File

@@ -125,10 +125,12 @@ namespace
{
std::string filter;
std::string position("$");
int batchSize = 1;
_conn.subscribe(channel,
filter,
position,
batchSize,
[this](const Json::Value& msg, const std::string& /*position*/) {
spdlog::info("receive {}", msg.toStyledString());

View File

@@ -76,10 +76,12 @@ namespace
log("Subscriber authenticated");
std::string filter;
std::string position("$");
int batchSize = 1;
conn.subscribe(channel,
filter,
position,
batchSize,
[](const Json::Value& msg, const std::string& /*position*/) {
log(msg.toStyledString());