(cobra client) can subscribe with a position
This commit is contained in:
@ -122,8 +122,10 @@ namespace
|
||||
void CobraChat::subscribe(const std::string& channel)
|
||||
{
|
||||
std::string filter;
|
||||
std::string position("$");
|
||||
|
||||
_conn.subscribe(
|
||||
channel, filter, [this](const Json::Value& msg, const std::string& /*position*/) {
|
||||
channel, filter, position, [this](const Json::Value& msg, const std::string& /*position*/) {
|
||||
spdlog::info("receive {}", msg.toStyledString());
|
||||
|
||||
if (!msg.isObject()) return;
|
||||
|
@ -93,8 +93,10 @@ namespace
|
||||
{
|
||||
log("Subscriber authenticated");
|
||||
std::string filter;
|
||||
std::string position("$");
|
||||
|
||||
conn.subscribe(
|
||||
CHANNEL, filter, [](const Json::Value& msg, const std::string& /*position*/) {
|
||||
CHANNEL, filter, position, [](const Json::Value& msg, const std::string& /*position*/) {
|
||||
log(msg.toStyledString());
|
||||
|
||||
std::string id = msg["id"].asString();
|
||||
|
@ -153,6 +153,7 @@ TEST_CASE("Cobra_to_sentry_bot", "[foo]")
|
||||
std::thread publisherThread(runPublisher, config, channel);
|
||||
|
||||
std::string filter;
|
||||
std::string position("$");
|
||||
bool verbose = true;
|
||||
bool strict = true;
|
||||
size_t maxQueueSize = 10;
|
||||
@ -182,6 +183,7 @@ TEST_CASE("Cobra_to_sentry_bot", "[foo]")
|
||||
int sentCount = cobra_to_sentry_bot(config,
|
||||
channel,
|
||||
filter,
|
||||
position,
|
||||
sentryClient,
|
||||
verbose,
|
||||
strict,
|
||||
|
Reference in New Issue
Block a user