Skip to content

Instantly share code, notes, and snippets.

@bryanhunter
Created September 27, 2012 20:49
Show Gist options
  • Select an option

  • Save bryanhunter/3796385 to your computer and use it in GitHub Desktop.

Select an option

Save bryanhunter/3796385 to your computer and use it in GitHub Desktop.
What is the "abcast" returned by the Erlang BIF c:nl(Module)?

Example

nl(Blabber).
abcast

What's being called?

    c:nl(M)
     calls 
      rpc:eval_everywhere(code, load_binary, [Mod, Fname, Bin]);
        which calls 
         gen_server:abcast(Nodes, ?NAME, {cast,Mod,Fun,Args,group_leader()}).
          which calls
           gen_server:do_abcast([node() | nodes()], Name, cast_msg(Request))

gen_server:do_abcast

  do_abcast([Node|Nodes], Name, Msg) when is_atom(Node) ->
     do_send({Name,Node},Msg),
     do_abcast(Nodes, Name, Msg);
  do_abcast([], _,_) -> abcast.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment