Packages

Erlang round-robin load balancer for Erlang processes based on ETS

Current section

Files

Jump to
erlpool test dummy_worker.erl
Raw

test/dummy_worker.erl

-module(dummy_worker).
-behaviour(gen_server).
-export([start_link/1, init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
start_link(_Args) ->
gen_server:start_link(?MODULE, [], []).
init(Args) ->
{ok, Args}.
handle_call(get, _From, State) ->
{reply, <<"ok">>, State};
handle_call(_Request, _From, State) ->
{reply, ok, State}.
handle_cast(_Msg, State) ->
{noreply, State}.
handle_info(stop, State) ->
{stop, shutdown, State};
handle_info({'EXIT', _, _}, State) ->
{stop, shutdown, State};
handle_info(_Info, State) ->
{noreply, State}.
terminate(_Reason, _State) ->
ok.
code_change(_OldVsn, State, _Extra) ->
{ok, State}.