{"action":"created","issue":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/5440","repository_url":"https://api.github.com/repos/elixir-lang/elixir","labels_url":"https://api.github.com/repos/elixir-lang/elixir/issues/5440/labels{/name}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/issues/5440/comments","events_url":"https://api.github.com/repos/elixir-lang/elixir/issues/5440/events","html_url":"https://github.com/elixir-lang/elixir/issues/5440","id":188696399,"number":5440,"title":"GenServer.cast/2 different behaviour","user":{"login":"michalmuskala","id":477062,"avatar_url":"https://avatars.githubusercontent.com/u/477062?v=3","gravatar_id":"","url":"https://api.github.com/users/michalmuskala","html_url":"https://github.com/michalmuskala","followers_url":"https://api.github.com/users/michalmuskala/followers","following_url":"https://api.github.com/users/michalmuskala/following{/other_user}","gists_url":"https://api.github.com/users/michalmuskala/gists{/gist_id}","starred_url":"https://api.github.com/users/michalmuskala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalmuskala/subscriptions","organizations_url":"https://api.github.com/users/michalmuskala/orgs","repos_url":"https://api.github.com/users/michalmuskala/repos","events_url":"https://api.github.com/users/michalmuskala/events{/privacy}","received_events_url":"https://api.github.com/users/michalmuskala/received_events","type":"User","site_admin":false},"labels":[{"id":17739153,"url":"https://api.github.com/repos/elixir-lang/elixir/labels/App:Elixir","name":"App:Elixir","color":"CCCCCC","default":false},{"id":4930795,"url":"https://api.github.com/repos/elixir-lang/elixir/labels/Kind:Enhancement","name":"Kind:Enhancement","color":"009800","default":false},{"id":778790,"url":"https://api.github.com/repos/elixir-lang/elixir/labels/Note:Discussion","name":"Note:Discussion","color":"bfdadc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-11T06:47:52Z","updated_at":"2016-11-11T13:23:15Z","closed_at":null,"body":"Currently the implementation of `GenServer.cast/2` and `:gen_server.cast/2` differ slightly in how remote, not connected nodes, are handled. The Elixir version will try connecting synchronously to the node, while the erlang version will do this asynchronously spawning a process to do so.\r\n\r\nElixir: https://github.com/elixir-lang/elixir/blob/master/lib/elixir/lib/gen_server.ex#L796-L803\r\n```elixir\r\n  defp do_send(dest, msg) do\r\n    try do\r\n      send(dest, msg)\r\n      :ok\r\n    catch\r\n      _, _ -> :ok\r\n    end\r\n  end\r\n```\r\n\r\nErlang: https://github.com/erlang/otp/blob/maint/lib/stdlib/src/gen_server.erl#L401-L407\r\n```erlang\r\ndo_send(Dest, Msg) ->\r\n    case catch erlang:send(Dest, Msg, [noconnect]) of\r\n\tnoconnect ->\r\n\t    spawn(erlang, send, [Dest,Msg]);\r\n\tOther ->\r\n\t    Other\r\n    end.\r\n```\r\n\r\nShould the elixir version be changed to mirror the erlang one?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/comments/259956226","html_url":"https://github.com/elixir-lang/elixir/issues/5440#issuecomment-259956226","issue_url":"https://api.github.com/repos/elixir-lang/elixir/issues/5440","id":259956226,"user":{"login":"michalmuskala","id":477062,"avatar_url":"https://avatars.githubusercontent.com/u/477062?v=3","gravatar_id":"","url":"https://api.github.com/users/michalmuskala","html_url":"https://github.com/michalmuskala","followers_url":"https://api.github.com/users/michalmuskala/followers","following_url":"https://api.github.com/users/michalmuskala/following{/other_user}","gists_url":"https://api.github.com/users/michalmuskala/gists{/gist_id}","starred_url":"https://api.github.com/users/michalmuskala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalmuskala/subscriptions","organizations_url":"https://api.github.com/users/michalmuskala/orgs","repos_url":"https://api.github.com/users/michalmuskala/repos","events_url":"https://api.github.com/users/michalmuskala/events{/privacy}","received_events_url":"https://api.github.com/users/michalmuskala/received_events","type":"User","site_admin":false},"created_at":"2016-11-11T13:23:15Z","updated_at":"2016-11-11T13:23:15Z","body":"If we're aiming for different semantics it makes a perfect sense to have different implementation. I wasn't aware of the semantic difference between `GenServer.cast/2` and `:gen_server.cast/2`. Is this something that should be explicitly indicated in the docs?"}}
{"actor":{"display_login":"michalmuskala"}}