gen_server partial replies

Bengt Kleberg Bengt.Kleberg@REDACTED
Mon Nov 24 10:28:54 CET 2003


Mikael Karlsson wrote:
> fredag 21 november 2003 17:29 skrev Bengt Kleberg:
> 
...deleted
> 
> 
> Great info, I did not know this!
> I can see from the gen_server code that this works for handle_call/3 were you 
> have a choice of returning {reply, Reply, NState} or {noreply, NState}.  
> In the system documentation:
> http://www.erlang.org/doc/r9c/doc/design_principles/part_frame.html
> this is not obvious to me though, as I can only see the asynchronous 
> handle_cast mentioned for {noreply, NState}.

i only knew about this because i had the privilige of attending an otp 
course (by Cesarini Consulting Ltd, see 
http://www.erlang-consulting.com/training_fs.html). it helps having a 
teacher that has read all the docuemntatiuon and found the most relevant 
bits.

the manual page for gen_server (as found by matthias excellent web page 
http://www.corelatus.com/~matthias/modules.html) says (about handle_call/3):


If the functions returns {noreply,NewState} or 
{noreply,NewState,Timeout}, the gen_server will continue executing with 
NewState. Any reply to From must be given explicitly using 
gen_server:reply/2.


just one sentence, but there it is.


bengt




More information about the erlang-questions mailing list