123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- -module(syn_test_gen_server).
- -behaviour(gen_server).
- -export([start_link/2, stop/1]).
- -export([
- init/1,
- handle_call/3,
- handle_cast/2,
- handle_info/2,
- terminate/2,
- code_change/3
- ]).
- start_link(Parent, Name) ->
- gen_server:start_link(Name, ?MODULE, Parent, []).
- stop(Server) ->
- gen_server:cast(Server, stop).
- init(State) ->
- {ok, State}.
- handle_call(_Request, _From, State) ->
- {reply, call_received, State}.
- handle_cast(stop, State) ->
- State ! stop_received,
- {stop, normal, State};
- handle_cast(_Msg, State) ->
- State ! cast_received,
- {noreply, State}.
- handle_info(_Info, State) ->
- State ! info_received,
- {noreply, State}.
- terminate(_Reason, _State) ->
- ok.
- code_change(_OldVsn, State, _Extra) ->
- {ok, State}.
|