Initial
This commit is contained in:
25
lib/main.ex
Normal file
25
lib/main.ex
Normal 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
|
||||
Reference in New Issue
Block a user