rewrite pig server by elixir