[erlang-questions] Fwd: Re: Generic server and selective receives

ludovic@REDACTED ludovic@REDACTED
Mon Feb 17 10:38:23 CET 2014


Thank you for yours answers. With timer:no_diff/ is quite easy to handle 
"selective timeout" in a gen server so okay it could be a decent 
solution. The only problem is to have code to handle it in every 
callback that reset the timeout, this is okay. But I would not use a 
gen_fsm, because if you look at my first implementation, when there's no 
client the messages that are NOT {set_client, ...} are not discarded, 
they are stacked in the process mailbox for later use and this is 

Le 2014-02-17 10:11, Anthony Ramine a écrit :
> You don’t have to reimplement ‘gen’ to implement a sys process, no.

As i may need to implement several processes with this kind of "client 
presence enforcement", implementing a sys process could be worth trying. 
(Plus i'll learn a lot). Have you got any link to a good tutorial/guide 


-- lud

More information about the erlang-questions mailing list