This simple code is not working
defmodule ElixirCluster do
use Application
def start(_type, _args) do
import Supervisor.Spec, warn: false
children = [
worker(Task, [fn ->
IO.puts("Hello")
Process.sleep(1000) #:timer.sleep(1000)
IO.puts("World")
end])
]
opts = [strategy: :one_for_one, name: ElixirCluster.Supervisor]
Supervisor.start_link(children, opts)
end
end
it only prints Hello
and then the program stop, it doesn’t even retry, and never prints World
. I dont have a clue what is wrong here.