[erlang-questions] gen_server handle_cast -> {noreply, State, Timeout}

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Thu Feb 17 15:13:14 CET 2011


On Thu, Feb 17, 2011 at 14:43, Nav <orionqwest@REDACTED> wrote:
>
> My requirement is that if handle_cast(pattern2, State) is not called
> at least once in every 5 sec, some Actions should be taken.
>

Your problem is that the timer is reset if one of the other patterns
match and then you don't install another timeout (since the other
cases does not have 5000 in timeout). I would be looking at a solution
based on erlang:send_after/3.

-- 
J.


More information about the erlang-questions mailing list