view 5-Erlang/networked_server.erl @ 82:cf7182bca068

Notes on infinite sequences Plus a clarification on "some"
author IBBoard <dev@ibboard.co.uk>
date Sat, 08 Jun 2019 14:00:25 +0100
parents 75dbcd30dee5
children
line wrap: on
line source

-module(networked_server).
-export([loop/0]).

loop() ->
    receive
        { Pid, "casa" } ->
            Pid ! "house",
            loop();
        { Pid, "blanca" } ->
            Pid ! "white",
            loop();
        { Pid, _ } ->
            Pid ! "*blank stare*",
            loop()
end.