Skip to content

Instantly share code, notes, and snippets.

@filipevarjao
Created August 10, 2021 00:33
Show Gist options
  • Save filipevarjao/50c6399989c609e10653f558b53a8e62 to your computer and use it in GitHub Desktop.
Save filipevarjao/50c6399989c609e10653f558b53a8e62 to your computer and use it in GitHub Desktop.
Chat.ex
# 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