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
@@ -9,7 +9,7 @@ namespace api {
|
||||
// defined in ApiClientInterop.h
|
||||
std::string base_topic(const char* type_name, const char* service_qualifier);
|
||||
bts::qbus::RPCServiceName rpc_topic(const std::string& base_topic);
|
||||
bts::qbus::Topic stream_topic(const std::string& base_topic, const char* method_and_qualifier);
|
||||
bts::qbus::Topic stream_topic(const std::string& base_topic, const char* method, const char* qualifier);
|
||||
|
||||
struct ApiServerCore {
|
||||
ApiServerCore(Quickbus& qbus, const std::string topic, const qbus::OnRPCRequest& handler) :
|
||||
@@ -51,9 +51,9 @@ CAPI void api_server_call_callback(ReplyHandler** ppvhandler, const uint8_t* buf
|
||||
*pphandler = nullptr;
|
||||
}
|
||||
|
||||
CAPI TableHandle api_server_create_table(ApiServerCore* pserver, const char* method_and_qualifier) {
|
||||
CAPI TableHandle api_server_create_table(ApiServerCore* pserver, const char* method, const char* qualifier) {
|
||||
bts_assert(pserver);
|
||||
auto topic = stream_topic(pserver->topic, method_and_qualifier);
|
||||
auto topic = stream_topic(pserver->topic, method, qualifier);
|
||||
LOG(Api,Info,"Create table: {}",topic.value());
|
||||
return new qbus::TablePublisher(pserver->qbus, topic);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user