ServerProcess ! {pause, 10}, % Receive messages sent to this process receive a_message -> do_something; {data, DataContent} -> handle(DataContent); {hello, Text} -> io:format("Got hello message: ~s", ); {goodbye, Text} -> io:format("Got goodbye message: ~s", ) end.
ServerProcess ! {pause, 10}, % Παραλαμβάνει μηνύματα που στέλνονται στη διεργασία receive a_message -> do_something; {data, DataContent} -> handle(DataContent); {hello, Text} -> io:format("Ήρθε μήνυμα hello: ~s", ); {goodbye, Text} -> io:format("Ήρθε μήνυμα goodbye: ~s", ) end.