[erlang-questions] timer:send_interval/3 how to return {error, Reason} value?

Kenneth Lundin kenneth.lundin@REDACTED
Thu Oct 16 09:59:51 CEST 2008


The timer server does never call exit/1.
The timer server is never supposed to crash, it will be a shutdown of
the whole E-node if it does.
The function timer:send_interval(Time,ReceiverPid,Message) will return
{ok,Ref} if everything is ok and
{error,badarg} if Time is not an integer, if ReceiverPid is not a pid.


/Kenneth Erlang/OTP team, Ericsson

2008/10/16 litao cheng <litaocheng@REDACTED>:
> Hi, everyone.
> When I use timer:send_interval/3, I have some puzzle with the return values:
> {ok, TRef}, {error, Reason}.
> I see the timer.erl, I know that the timer module is implented by gen_server
> behaviour, the exported functions such as send_after, apply_after and so on,
> are just call the gen_server:call/2. the gen_server:call/2 may invoke
> erlang:exit/1 with some reasons,
> but in the timer.erl the timer:req/2 don't catch the exit signal. So I
> wonder how the timer:send_interval/3 return {error, Reason}. Is it a bug?
>
> BS!
> litaocheng
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list