Skip to content

Commit fecafdd

Browse files
committed
feat(jsonrpc): 添加removeService()
1 parent 34e8973 commit fecafdd

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

modules/jsonrpc/rpc.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ void Rpc::addService(const std::string &method, ServiceCallback &&cb)
9292
method_services_[method] = std::move(cb);
9393
}
9494

95+
void Rpc::removeService(const std::string &method)
96+
{
97+
method_services_.erase(method);
98+
}
99+
95100
void Rpc::request(const std::string &method, const Json &js_params, RequestCallback &&cb)
96101
{
97102
RECORD_SCOPE();

modules/jsonrpc/rpc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ class Rpc {
6969

7070
//! 添加方法被调用时的回调函数
7171
void addService(const std::string &method, ServiceCallback &&cb);
72+
//! 删除方法
73+
void removeService(const std::string &method);
7274

7375
//! 发送请求(需要回复的)
7476
void request(const std::string &method, const Json &js_params, RequestCallback &&cb);

version.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
# TBOX版本号
2222
TBOX_VERSION_MAJOR := 1
2323
TBOX_VERSION_MINOR := 13
24-
TBOX_VERSION_REVISION := 2
24+
TBOX_VERSION_REVISION := 3

0 commit comments

Comments
 (0)