[erlang-questions] origin of handle_info/2
Richard Carlsson
carlsson.richard@REDACTED
Thu Mar 16 23:10:59 CET 2017
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.
/Richard
2017-03-16 16:33 GMT+01:00 Xavier Noria <fxn@REDACTED>:
> A curiosity,
>
> Where does the `handle_info` callback name come from? The name does not
> suggest what the method is invoked for to me.
>
> I wonder if there is a historical background behind that name, or perhaps
> "info" reflects usage in a way that I fail to see.
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170316/fb780dda/attachment.htm>
More information about the erlang-questions
mailing list