I have a Task.Supervisor like this:
def start_link() do
Task.Supervisor.start_link(name: __MODULE__)
end
def child_spec(_) do
%{
id: __MODULE__,
start: {__MODULE__, :start_link, []},
type: :supervisor,
strategy: :one_for_one
}
end
def retrieve_room_data(shutdown_time) do
Task.Supervisor.start_child(__MODULE__, &Room.retrieve_data/0, shutdown: shutdown_time)
end
But it is not shuting down the task even if Room.retrieve_data/0
takes longer than shutdown_time
.
Did I misunderstood something about the shutdown option?