This commit is contained in:
Emin Arslan
2025-02-16 19:14:35 +03:00
commit 1503ca4fab
9 changed files with 194 additions and 0 deletions

25
lib/main.ex Normal file
View File

@@ -0,0 +1,25 @@
defmodule Broadcast do
@moduledoc """
A simple broadcast server
"""
use Application
def console_loop() do
case IO.read(:stdio, :line) do
"mem\n" ->
IO.inspect :erlang.memory()
_ -> IO.puts "unknown command entered"
end
console_loop()
end
def main(_args \\ []) do
IO.puts "started"
{:ok, _} = Broadcast.Server.start(8080)
console_loop()
end
def start(_type, _args) do
main()
end
end