Elixir 把Erlang代码转换为Elixir

项目地址:

https://github.com/developerworks/ws_cowboy

项目描述文件mix.exs

1
defmodule WsCowboy.Mixfile do
  use Mix.Project
  def project do
    [app: :ws_cowboy,
     version: "0.0.1",
     elixir: "~> 1.0",
     deps: deps]
  end
  def application do
    [
      applications: [:logger, :cowboy],
      mod: {WsCowboy, []}
    ]
  end
  defp deps do
    [{:cowboy,"~> 1.0.0"}]
  end
end

Application

Application

Supervisor

Supervisor

Websocket Handler

Websocket Handler

运行结果

运行结果

参考资料

  1. Converting Erlang code into Elixir
    http://blog.plataformatec.com.br/2014/11/converting-erlang-code-into-elixir/