3 ms·
I believe you're mistaken about this one: > Automatic cancellation of requests that have taken too long. For example, in Erlang it is necessary for application
by dnautics 7y ago
I believe you're mistaken about this one:
> Automatic cancellation of requests that have taken too long. For example, in Erlang it is necessary for application programmers to explicitly code a time-out for each message send that might take too long.
https://hexdocs.pm/elixir/GenServer.html#call/3 https://hexdocs.pm/elixir/GenServer.html#call/3
> timeout is an integer greater than zero which specifies how many milliseconds to wait for a reply, or the atom :infinity to wait indefinitely. The default value is 5000. If no reply is received within the specified time, the function call fails and the caller exits.
- senderista 7y agoThat's the gen_server functional interface, not the message send primitive (!).
- dnautics 7y agoAha, thanks. I guess I'm not clear as to why an actor would care about the egress time of a message (unless it were waiting for a response)
- rkangel 7y agoThat's OK. It doesn't matter at what abstraction layer the timeout is taken care of as long as it is taken care of. That it's in a library rather than the language core is an irrelevant distinction.
- strmpnk 7y agoIt’s technically the receive primitive doing this using the after clause. The addition of unique references and selective receive then allows “call” style interactions to built (like gen_server). Likewise, links and monitors are used for lifetime concerns instead of reference counting actors like Pony or using a global tracing collector. This has some advantages and disadvantages but for the most part I personally find it far more practical than other models which are more like the classic actor model.