Load multi functions with Task.Supervisor

Hello, I have a 3 functions that load different table of my database. but pleas assume, I have these function.

defmodule WeddingCardWeb.AdminInvoicesController do

 def fn1(invoice_id)
  invoice_id + 1
 end

 def fn3(invoice_id)
  invoice_id + 1
 end

 def fn3(invoice_id)
  invoice_id + 1
 end
end

now I want to load those functions in Task, I need to use Task.Supervisor, because it loads database.

now I edited my application file:

  def start(_type, _args) do
    # List all child processes to be supervised
    children = [
      WeddingCard.Repo,
      WeddingCardWeb.Endpoint,
      {Task.Supervisor, name: WeddingCardWeb.AdminInvoicesController}
    ]

    opts = [strategy: :one_for_one, name: WeddingCard.Supervisor]
    Supervisor.start_link(children, opts)
  end

and for loading I use this:

  def extera_finder(invoice_id) do
    Task.Supervisor.async WeddingCardWeb.AdminInvoicesController, fn ->
      :timer.sleep(10000)
      IO.puts "by Shahryar tavakkoli #{invoice_id}"
    end
  end

but I don’t know how to create the code that loads my 3 functions, and put their result in a map instead of this code:

:timer.sleep(10000)
 IO.puts "by Shahryar tavakkoli #{invoice_id}"

In the end I need like this: %{function1, function2, function3}

before I created a simple project with one function like this, but not 3 functions:

   def extera_finder(invoice_id) do
    Task.Supervisor.async WeddingCardWeb.AdminInvoicesController, fn ->
      function_name(invoice_id)
    end
  end

  def function_name(invoice_id) do
    :timer.sleep(100)
    invoice_id
    |> Enum.map(fn inv -> "by Shahryar tavakkoli #{inv}" end)
    |> IO.inspect
  end

and I load it like this way:

cities = ["Singapore", "Monaco", "Vatican City", "Hong Kong", "Macaus", "Amol","Tehran","Esfahan","Zanjan"]
WeddingCardWeb.AdminInvoicesController.extera_finder cities 

how can I do this with 3 functions?

Hello, I have found a way to create my wanted Task like this:

  def test2 do
    [remover(:fn1), remover(:fn2), remover(:fn3)]
    |> Enum.map(&Task.await/1)
  end

  def remover(function_name) do
    Task.Supervisor.async(WeddingCardWeb.AdminInvoicesController,
      fn -> apply(WeddingCardWeb.AdminInvoicesController, function_name, [])
    end)
  end

  def fn1 do
    :timer.sleep(100)
    %{name: "fun1"}
  end

  def fn2 do
    :timer.sleep(100)
    %{name: "fun2"}
  end

  def fn3 do
    :timer.sleep(100)
    %{name: "fun3"}
  end

and my problem was solved, if the way is true, it will be helpful for me, but I have a new problem.

** (exit) exited in: Task.await(%Task{owner: #PID<0.530.0>, pid: #PID<0.697.0>, ref: #Reference<0.640960142.3406823425.196169>}, 5000)
    ** (EXIT) time out

if :timer.sleep(100) is edited to :timer.sleep(100000) , I will have a time out error, How can I set a time to load this and how to load this until it is spend?

and then I fixed this:
https://hexdocs.pm/elixir/Task.html#await/2

await(task, timeout \\ 5000)