Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -module(maybe_server).
- -behaviour(gen_server).
- -export([start_link/0, stop/0]).
- -export([init/1, terminate/2, handle_call/3, handle_cast/2]).
- %% EXTERNAL API ------------------------------------------------------------------------------------
- start_link() -> gen_server:start_link({local, ?MODULE}, ?MODULE, #{}, [{debug, [log, trace]}]).
- stop() -> gen_server:stop(?MODULE).
- %% CALLBACKS ---------------------------------------------------------------------------------------
- init(#{}) ->
- error_logger:info_msg("Server ~p starting.~n", [self()]),
- {ok, #{}}.
- terminate(Reason, _State) ->
- error_logger:info_msg("Server ~p terminating with reason ~p~n", [self(), Reason]).
- %% UNUSED CALLBACKS --------------------------------------------------------------------------------
- handle_call(_Msg, _From, State) -> {noreply, State}.
- handle_cast(_Msg, State) -> {noreply, State}.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement