[erlang-questions] origin of handle_info/2
Fri Mar 17 12:36:20 CET 2017
On 2017-03-17 10:58, Richard Carlsson wrote:
> No, I think it's more to do with the fact that the original authors were not native English speakers, and thought "info" was a good enough shorthand for "any other stuff that someone sends us".
Well, some of the original authors were (are) native English speakers:-)
- but in any case, what's wrong with "info"? Some process, or the VM,
sent us a message - seems like a reasonable assumption that there is
some relevant information in it, but that's pretty much the only
assumption that can be made.
Maybe the OP has a term in mind, that would be better at conveying the
meaning "any other stuff that someone sends us"?
> 2017-03-16 23:57 GMT+01:00 Xavier Noria <fxn@REDACTED <mailto:fxn@REDACTED>>:
> On Thu, 16 Mar 2017 at 23:11, Richard Carlsson <carlsson.richard@REDACTED <mailto: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
> erlang-questions mailing list
More information about the erlang-questions