about summary refs log tree commit diff
path: root/presentations/erlang-2016/src/hello_server.erl
diff options
context:
space:
mode:
Diffstat (limited to 'presentations/erlang-2016/src/hello_server.erl')
-rw-r--r--presentations/erlang-2016/src/hello_server.erl12
1 files changed, 12 insertions, 0 deletions
diff --git a/presentations/erlang-2016/src/hello_server.erl b/presentations/erlang-2016/src/hello_server.erl
new file mode 100644
index 000000000000..01df14ac57d5
--- /dev/null
+++ b/presentations/erlang-2016/src/hello_server.erl
@@ -0,0 +1,12 @@
+-module(hello_server).
+-export([start_server/0, server/0]).
+
+start_server() ->
+    spawn(fun() -> server() end).
+
+server() ->
+    receive
+        {greet, Name} ->
+            io:format("Hello ~s!~n", [Name]),
+            hello_server:server()
+    end.