Created
August 10, 2021 00:33
-
-
Save filipevarjao/50c6399989c609e10653f558b53a8e62 to your computer and use it in GitHub Desktop.
Chat.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Client chat | |
defmodule Chat do | |
require Logger | |
def msg_loop() do | |
receive do | |
{:message_type, value} -> | |
spawn(fn -> Logger.info("Msg: #{value}") end) | |
end | |
msg_loop() | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment