为什么使用 "cast" 这个词来处理 GenServer 中的异步消息?

Why is the word "cast" used to handle async message in a GenServer?

为什么在 Erlang/Elixir 中,异步 GenServer 处理程序以 handle_cast 命名? handle_ 部分很明显,但为什么 cast?

我唯一能想到的是,它类似于把东西扔出去(如 casting a net)与 call出去办事并等待回复。

我想你已经自己回答了这个问题。

The only thing I can think of is that it is akin to just throwing something out there (as in casting a net) vs calling out for something and waiting for a reply.

不过,除了询问 erlang 的创造者,我们只能推测。

Cast: to cause to move or send forth by throwing

基本上,您是在 向 GenServer 发送 一条消息,并不期望得到响应。

Call: to make a request or demand

我认为这是期待回应的事情。如果您打电话给某人,您希望他们接听。