[erlang-questions] [gen_server] time out error when handle_call returns {noreply, State}

Taavi Talvik taavi@REDACTED
Wed May 28 00:58:09 CEST 2008


On May 28, 2008, at 1:14 AM, Marcin Maciukiewicz wrote:

> Hi,
>
> This are my first steps in Erlang World. So far I'm stuck with
> gen_server:Module:handle_call/3.
> I get time out every time when {noreply, State} is returned. Following
> are code snippets:
> * Server module: http://pastebin.com/f590f0e00

alloc(Pid) -> gen_server:call(?MODULE, {alloc, Pid}, infinity).

handle_call({alloc, Pid}, From, State) ->
    ... some logic to save caller information From..
    {noreply, State}.

and somwhere else in code

gen_server:reply(From, finally_my_answer_is_ready).


or

handle_call({alloc, Pid}, From, State) ->
    {reply, my_answer_is_allready_available, State}.

if you can answer immediately.

best regards,
taavi



More information about the erlang-questions mailing list