I don't know how I can match my asynchronous function and my handle_info
this code works:
def order_month() do
Task.async(fn ->
(1..12)
|> Enum.map(fn a -> %{months: a} |> Map.put(:order_months, Proyect.BuyHandler.order_month(a |> Integer.to_string())
|> Enum.map(fn m -> m |> Proyect.BuyHandler.get_opc() end))end)
end)
end
my intention is to receive it this way:
def handle_info({_ref, %{months: month, order_months: order_months}}, socket) do
{:noreply, assign(socket, %{months: month, order_months: order_months} )}