partizan.ex 605 B

12345678910111213141516171819202122232425262728293031323334
  1. defmodule Partizan.Makine do
  2. use GenServer
  3. require Logger
  4. def start_link() do
  5. GenServer.start_link __MODULE__, %{}
  6. end
  7. @moduledoc """
  8. Documentation for Partizan.
  9. """
  10. @doc """
  11. Hello world.
  12. ## Examples
  13. iex> Partizan.hello()
  14. :world
  15. """
  16. def hello do
  17. :world
  18. end
  19. def init(_state) do
  20. Logger.info "PArixzannn server started"
  21. port = Application.get_env(:partizan, :listen_port)
  22. ip = Application.get_env(:partizan, :listen_ip)
  23. :partisan_config.set(:listen_addrs,[%{ip: ip, port: port}])
  24. state = :partisan.start
  25. {:ok, state}
  26. end
  27. end