(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

@ -562,11 +562,13 @@ namespace ix
void CobraConnection::subscribe(const std::string& channel,
const std::string& filter,
const std::string& position,
int batchSize,
SubscriptionCallback cb)
{
// Create and send a subscribe pdu
Json::Value body;
body["channel"] = channel;
body["batch_size"] = batchSize;
if (!filter.empty())
{

View File

@ -88,6 +88,7 @@ namespace ix
void subscribe(const std::string& channel,
const std::string& filter = std::string(),
const std::string& position = std::string(),
int batchSize = 1,
SubscriptionCallback cb = nullptr);
/// Unsubscribe from a channel