'after' in gen_server

orbitz <>
Thu Mar 23 16:42:04 CET 2006


I am reworking a bit of code into gen_server pattern.  In this code I 
have a typical loop construct.  In this I want to perform an action if 
no messages have been receive in a certain amount of time, to do this I 
simply have after sometimeout ->.  Is there any equivalence of this in 
gen_server?
It has been suggested that I use a timer and record when the last 
message has come in and when the timer signals check against that 
message.  This seems a poor solution.  Another suggestions was to use a 
gen_fsm with a timeout, but this seem a bit much just to get an 'after' 
mechanism. Any other suggestions?  Perhaps my disregard of gen_fsm is a 
bit hasty?




More information about the erlang-questions mailing list