This commit is contained in:
anlicheng 2023-06-15 17:54:00 +08:00
parent 881dc36e62
commit 98501ad6c5

View File

@ -13,7 +13,7 @@
%% API
-export([start_link/1, stop/0]).
-export([test/0]).
-export([test/0, ping/0]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
@ -74,6 +74,10 @@ test() ->
stop() ->
gen_server:stop(?MODULE).
ping() ->
Pid = whereis(?MODULE),
erlang:start_timer(0, Pid, ping_ticker).
%% @doc Spawns the server and registers the local name (unique)
-spec(start_link(UUID :: binary()) ->
{ok, Pid :: pid()} | ignore | {error, Reason :: term()}).