Api: centralize formatting stream topic+qualifier

This commit is contained in:
Eric Harding committed 2018-12-05 11:33:13 -05:00
1 parent a0c572ef2e
commit 0bdd2dfca0
19 files changed
+41 -55

No files matched your search

+3 -3
View File
@@ -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);
}