[erlang-questions] gen_server: handle_cast/2 vs handle_info/2

Ulf Wiger ulf@REDACTED
Thu Aug 14 18:43:12 CEST 2008


One strategy is to use cast for all application-specific messages,
where you control the sender, and catch everything else in
handle_info().

BR,
Ulf W

2008/8/14 Vincent de Phily <vincent.dephily@REDACTED>:
> Hi,
>
> I've got an app with some gen_servers that use a seemingly random mix of
> handle_cast/2 and handle_info/2, with no visible reason to choose one over
> the other.
> It seems to me they both have the exact same functionality, with probably just
> a little more overhead int the handle_cast/2 case.
>
> Is there a real reason to use one over the other (I control the sender too; my
> nodes are not all on the same machine but they're all constantly up and
> chating), or is it just a matter of taste ?
> --
> Vincent de Phily
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list