RPC batch

This commit is contained in:
terry-xiaoyu 2019-07-27 20:44:44 +08:00
parent b0e2b7db0c
commit 20a7ed6f53
3 changed files with 14 additions and 1 deletions

View File

@ -297,6 +297,14 @@ node.dist_listen_max = 6369
## Value: sync | async ## Value: sync | async
rpc.mode = async rpc.mode = async
## Max batch size of async RPC requests.
##
## Value: Integer
## Zero or negative value disables rpc batching.
##
## NOTE: RPC batch won't work when rpc.mode = sync
rpc.async_batch_size = 256
## TCP server port for RPC. ## TCP server port for RPC.
## ##
## Value: Port [1024-65535] ## Value: Port [1024-65535]

View File

@ -344,6 +344,11 @@ end}.
{datatype, {enum, [sync, async]}} {datatype, {enum, [sync, async]}}
]}. ]}.
{mapping, "rpc.async_batch_size", "gen_rpc.max_batch_size", [
{default, 256},
{datatype, integer}
]}.
%% RPC server port. %% RPC server port.
{mapping, "rpc.tcp_server_port", "gen_rpc.tcp_server_port", [ {mapping, "rpc.tcp_server_port", "gen_rpc.tcp_server_port", [
{default, 5369}, {default, 5369},

View File

@ -103,7 +103,7 @@ record(Group, Topic, SubPid) ->
#emqx_shared_subscription{group = Group, topic = Topic, subpid = SubPid}. #emqx_shared_subscription{group = Group, topic = Topic, subpid = SubPid}.
-spec(dispatch(emqx_topic:group(), emqx_topic:topic(), emqx_types:delivery()) -spec(dispatch(emqx_topic:group(), emqx_topic:topic(), emqx_types:delivery())
-> emqx_topic:deliver_result()). -> emqx_types:deliver_result()).
dispatch(Group, Topic, Delivery) -> dispatch(Group, Topic, Delivery) ->
dispatch(Group, Topic, Delivery, _FailedSubs = []). dispatch(Group, Topic, Delivery, _FailedSubs = []).