[erlang-questions] origin of handle_info/2

Xavier Noria fxn@REDACTED
Thu Mar 16 23:57:22 CET 2017


On Thu, 16 Mar 2017 at 23:11, Richard Carlsson <carlsson.richard@REDACTED>
wrote:

It's "info" in the sense of "any other messages to this process, that are
> not recognised as special OTP framework messages". When you use a function
> like gen_server:call(...), the OTP libraries wrap your message in a way
> that lets the receiving server process see that it is a part of the OTP
> framework and redirects it to the standard callbacks like handle_call() or
> handle_cast(). If you just send a message to the gen_server process with
> the ! operator, it will not have the right wrapper, and will be dispatched
> to handle_info(). Typical uses of info messages are timeouts and other
> "note to self" style messages.
>


Yes, that is the way it works, but "info" doesn't convey that meaning to
me. Does it to you?

I wondered if maybe historically it had a smaller contract where "info" was
a natural choice and with time the contract was relaxed up to accepting
anything but calls and casts.

> --
Sent from Gmail Mobile
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170316/8eb90ce6/attachment.htm>


More information about the erlang-questions mailing list