terry-xiaoyu 6 lat temu
rodzic
commit
20a7ed6f53
3 zmienionych plików z 14 dodań i 1 usunięć
  1. 8 0
      etc/emqx.conf
  2. 5 0
      priv/emqx.schema
  3. 1 1
      src/emqx_shared_sub.erl

+ 8 - 0
etc/emqx.conf

@@ -297,6 +297,14 @@ node.dist_listen_max = 6369
 ## Value: sync | 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.
 ##
 ## Value: Port [1024-65535]

+ 5 - 0
priv/emqx.schema

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

+ 1 - 1
src/emqx_shared_sub.erl

@@ -103,7 +103,7 @@ record(Group, Topic, SubPid) ->
     #emqx_shared_subscription{group = Group, topic = Topic, subpid = SubPid}.
 
 -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, _FailedSubs = []).