Api: centralize formatting stream topic+qualifier
This commit is contained in:
1 parent
a0c572ef2e
commit
0bdd2dfca0
19 files changed
+41
-55
No files matched your search
@@ -28,14 +28,14 @@ void QuickbusClientChannel::send_core(const std::string& request_envalope, OnRep
|
||||
api_client_send(_pclient, request_envalope.c_str(), request_envalope.size(), trampoline, heap_on_response);
|
||||
}
|
||||
|
||||
ClientChannel::Unsubscribe QuickbusClientChannel::subscribe_core(const std::string & method_and_qualifier, OnSubscriptionCB cb) {
|
||||
ClientChannel::Unsubscribe QuickbusClientChannel::subscribe_core(const char* method, const char* qualifier, OnSubscriptionCB cb) {
|
||||
raw_subscription_callback trampoline = [](EventType event_type, const StreamUpdate* changes, int count, void* extra) {
|
||||
OnSubscriptionCB* heap_cb = static_cast<OnSubscriptionCB*>(extra);
|
||||
assert(heap_cb != nullptr);
|
||||
(*heap_cb)(event_type, changes, count);
|
||||
};
|
||||
OnSubscriptionCB* heap_cb = new OnSubscriptionCB(cb);
|
||||
auto subscription = api_client_subscribe(_pclient, method_and_qualifier.c_str(), trampoline, heap_cb);
|
||||
auto subscription = api_client_subscribe(_pclient, method, qualifier, trampoline, heap_cb);
|
||||
return [this,subscription,heap_cb]() {
|
||||
api_client_unsubscribe(_pclient, subscription);
|
||||
delete heap_cb;
|
||||
|
||||
Reference in new issue
Block a user