(cobra client) pass the message position to the subscription data callback
This commit is contained in:
@ -441,9 +441,12 @@ namespace ix
|
||||
if (!body.isMember("messages")) return false;
|
||||
Json::Value messages = body["messages"];
|
||||
|
||||
if (!body.isMember("position")) return false;
|
||||
std::string position = body["position"].asString();
|
||||
|
||||
for (auto&& msg : messages)
|
||||
{
|
||||
cb->second(msg);
|
||||
cb->second(msg, position);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -42,7 +42,7 @@ namespace ix
|
||||
CobraConnection_PublishMode_Batch = 1
|
||||
};
|
||||
|
||||
using SubscriptionCallback = std::function<void(const Json::Value&)>;
|
||||
using SubscriptionCallback = std::function<void(const Json::Value&, const std::string&)>;
|
||||
using EventCallback = std::function<void(CobraConnectionEventType,
|
||||
const std::string&,
|
||||
const WebSocketHttpHeaders&,
|
||||
|
Reference in New Issue
Block a user