fix(export): Mod:call/3 not exported

This commit is contained in:
Shawn 2021-04-16 16:17:12 +08:00
parent 7b5422dbae
commit 5896e90235
4 changed files with 25 additions and 6 deletions

View File

@ -37,7 +37,9 @@
, stop/1 , stop/1
]). ]).
-export([call/2]). -export([ call/2
, call/3
]).
%% gen_server. %% gen_server.
-export([ init/1 -export([ init/1
@ -93,6 +95,9 @@ publish(Pid, Topic, Payload) ->
%% For emqx_management plugin %% For emqx_management plugin
call(Pid, Msg) -> call(Pid, Msg) ->
call(Pid, Msg, infinity).
call(Pid, Msg, _) ->
Pid ! Msg, ok. Pid ! Msg, ok.
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------

View File

@ -32,6 +32,7 @@
]). ]).
-export([ call/2 -export([ call/2
, call/3
, cast/2 , cast/2
]). ]).
@ -154,7 +155,10 @@ stats(#state{socket = Socket,
lists:append([SockStats, ConnStats, ChanStats, ProcStats]). lists:append([SockStats, ConnStats, ChanStats, ProcStats]).
call(Pid, Req) -> call(Pid, Req) ->
gen_server:call(Pid, Req, infinity). call(Pid, Req, infinity).
call(Pid, Req, Timeout) ->
gen_server:call(Pid, Req, Timeout).
cast(Pid, Req) -> cast(Pid, Req) ->
gen_server:cast(Pid, Req). gen_server:cast(Pid, Req).

View File

@ -36,7 +36,9 @@
]). ]).
%% For Mgmt %% For Mgmt
-export([call/2]). -export([ call/2
, call/3
]).
-record(lwm2m_state, { peername -record(lwm2m_state, { peername
, endpoint_name , endpoint_name
@ -63,7 +65,10 @@
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
call(Pid, Msg) -> call(Pid, Msg) ->
case catch gen_server:call(Pid, Msg) of call(Pid, Msg, 5000).
call(Pid, Msg, Timeout) ->
case catch gen_server:call(Pid, Msg, Timeout) of
ok -> ok; ok -> ok;
{'EXIT', {{shutdown, kick},_}} -> ok; {'EXIT', {{shutdown, kick},_}} -> ok;
Error -> {error, Error} Error -> {error, Error}

View File

@ -32,7 +32,9 @@
, stats/1 , stats/1
]). ]).
-export([call/2]). -export([ call/2
, call/3
]).
%% SUB/UNSUB Asynchronously, called by plugins. %% SUB/UNSUB Asynchronously, called by plugins.
-export([ subscribe/2 -export([ subscribe/2
@ -691,7 +693,10 @@ stats(#state{socket = Socket, channel = Channel}) ->
lists:append([SockStats, ConnStats, ChanStats, ProcStats]). lists:append([SockStats, ConnStats, ChanStats, ProcStats]).
call(Pid, Req) -> call(Pid, Req) ->
gen_server:call(Pid, Req, infinity). call(Pid, Req, infinity).
call(Pid, Req, Timeout) ->
gen_server:call(Pid, Req, Timeout).
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
%% Internal Functions %% Internal Functions