Created
July 25, 2009 23:26
-
-
Save cchandler/155217 to your computer and use it in GitHub Desktop.
Basic Erlang clustering example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lists:foldl(fun(Elem,Acc) -> % Anonymous function taking two params | |
Pid = spawn(Elem, fun() -> io:format("Hello",[]) end ), % Spawn a process to run the fun | |
Acc ++ [Pid] % Add the Pid of the new remote process into our accumulator so we can get it again later | |
end, [], nodes()) % The [] is our empty accumulator and nodes() will be every node we're connected to |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment