26 lines
453 B
Elixir
26 lines
453 B
Elixir
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
|