Sending a Message to a Process
- Erlang operators for concurrency
- Spawn processes
- Send messages to another process
- Receive messages from another process
- Example of sending a message
spawn_and_send(Msg, Fun) when is_function(Fun) ->
P1 = spawn(Fun), % Creates a new process
P1 ! {Msg, self()}. % Sends Msg tuple to new process