-module(my_module). -behaviour(gen_server). -export([start_link/0]). -export([ init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3 ]). -define(SERVER, ?MODULE). -record(state, { par1, par2 }). %%% API start_link() -> gen_server:start_link({local, ?SERVER}, ?MODULE, [], []). %%% gen_server callbacks init([]) -> {ok, #state{}}. handle_call(Request, _From, State) -> Error = {unknown_call, Request}, {stop, Error, {error, Error}, State}. -spec handle_cast(term(), #state{}) -> {noreply, NewState :: #state{}}. handle_cast({asd}, _State) -> NewState = {bugotak}, {noreply, NewState}; handle_cast(_Msg, State) -> {noreply, State}. handle_info(_Info, State) -> {noreply, State}. terminate(_Reason, _State) -> ok. code_change(_OldVsn, State, _Extra) -> {ok, State}. %%% Internal functions