gen_server vs. gen_fsm: Timeout type discrepancy?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

gen_server vs. gen_fsm: Timeout type discrepancy?

Kenneth Lakin
I know that I've looked at the relevant documentation like a million
times, but this just hit me:

In the documentation for gen_server:handle_*, the Timeout part of the
Result is typed as

int()>= 0 | infinity

However, in the gen_fsm:StateName documentation, Timeout is typed as

int()>0 | infinity

Given that I kinda expect the main loop of gen_fsm and gen_server to be
*really* similar, I would also expect the type for Timeout to be the
same for gen_fsm and gen_server. Is the documentation incorrect, or is
there a problem with my expectations?

If the documentation is incorrect, which definition of Timeout is correct?

Thanks!


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: gen_server vs. gen_fsm: Timeout type discrepancy?

Paul Peregud-2
gen_fsm:loop/7 uses receive ... after Time ... end where Time :: int()
>= 0 | infinity. So it must be error in gen_fsm:StateName
documentation.

On Tue, Dec 29, 2015 at 7:28 AM, Kenneth Lakin <[hidden email]> wrote:

> I know that I've looked at the relevant documentation like a million
> times, but this just hit me:
>
> In the documentation for gen_server:handle_*, the Timeout part of the
> Result is typed as
>
> int()>= 0 | infinity
>
> However, in the gen_fsm:StateName documentation, Timeout is typed as
>
> int()>0 | infinity
>
> Given that I kinda expect the main loop of gen_fsm and gen_server to be
> *really* similar, I would also expect the type for Timeout to be the
> same for gen_fsm and gen_server. Is the documentation incorrect, or is
> there a problem with my expectations?
>
> If the documentation is incorrect, which definition of Timeout is correct?
>
> Thanks!
>
>
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions
>



--
Best regards,
Paul Peregud
+48602112091
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions