Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Pid = spawn(Mod, Func, Args) % uruchamia funkcje Func jako nowy proces
- Pid = spawn(Node, Mod, Func, Args) % uruchamia funkcje Func na zdalnym węźle Node
- Pid ! a_message % wysyła wiadomość do procesu (asynchronicznie)
- receive % odbiera wiadomość wysłaną do tego procesu
- a_message -> do_something;
- {data, Data_content} -> do_something_else(); % To jest 2-ka składają się z atomu i pewnych danych
- {hello, Text} -> io:format("Got hello message: ~s", [Text]);
- {goodbye, Text} -> io:format("Got goodbye message: ~s", [Text])
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement