-module(spawner).

-behaviour(gen_server).

-export([code_change/3, handle_call/3, handle_cast/2, handle_info/2, init/1,
	 terminate/2]).

%% ======================================================================
%% GEN_SERVER CALLBACK FUNCTIONS
%% ======================================================================

init(_) ->
    {ok, init}.

handle_call(_Request, _From, State) ->
    {reply, ok, State}.

handle_cast(_Request, State) ->
    {noreply, State}.

handle_info({get_pid, UUID, Ref, From}, State) ->
    {ok, Pid} = gen_server:start(phonebooth, UUID, []),
    From ! {Ref, Pid},
    {noreply, State};
handle_info({new_pid, _Ref, _From}, State) ->
    {noreply, State}.

code_change(_OldVsn, State, _Extra) ->
    {ok, State}.

terminate(_Reason, _) ->
    ok.
