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

free.wang freefis@REDACTED
Thu Feb 17 15:28:22 CET 2011


you can use  gen_fsm

5000 just means the handle operations which costs 5000 ms at most.

On Thu, Feb 17, 2011 at 9:43 PM, Nav <orionqwest@REDACTED> wrote:

> I am not sure where I am going wrong having read the documentation :)
>
> init() -> {ok, State}
>
> handle_cast(pattern1, State) -> {noreply, State};
> handle_cast(pattern2, State) -> {noreply, State, 5000};
> handle_cast(pattern3, State) -> {noreply, State};
> handle_cast(All, State) -> {noreply, State}.
>
> handle_info(timeout, State) -> Actions, {noreply, State, 5000}.
>
>
> My requirement is that if handle_cast(pattern2, State) is not called
> at least once in every 5 sec, some Actions should be taken.
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>
>


-- 
真正的杰出,不是妙用规则的错层,而是极致的偏执于信念.
The Crankiness of  Belief achieves Great , not the Trick of Regulation.


More information about the erlang-questions mailing list