Find file
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (17 sloc) 306 Bytes
-module(echo).
-export([start/0, print/1, stop/0]).
start() ->
register(echo, erlang:spawn(fun loop/0)).
print(Term) ->
io:format("Received: ~w~n", [Term]).
stop() ->
io:format("Stopping"),
ok.
loop() ->
receive
stop ->
stop();
Term ->
print(Term),
loop()
end.