Parallel task worker in Elixir

defmodule Taskwork do
@moduledoc """
Generated by erl2ex (http://github.com/dazuma/erl2ex)
From Erlang source: (Unknown source file)
At: 2019-12-20 13:57:37

"""

def main() do
{:ok, context} = :erlzmq.context()
{:ok, receiver} = :erlzmq.socket(context, :pull)
:ok = :erlzmq.connect(receiver, 'tcp://localhost:5557')
{:ok, sender} = :erlzmq.socket(context, :push)
:ok = :erlzmq.connect(sender, 'tcp://localhost:5558')
loop(receiver, sender)
:ok = :erlzmq.close(receiver)
:ok = :erlzmq.close(sender)
:ok = :erlzmq.term(context)
end

def loop(receiver, sender) do
{:ok, work} = :erlzmq.recv(receiver)
:io.format('.')
:timer.sleep(:erlang.list_to_integer(:erlang.binary_to_list(work)))
:ok = :erlzmq.send(sender, "")
loop(receiver, sender)
end

end

Taskwork.main