I have the following code, which simulates a “worker queue”:
stream = Enum.map(~w(a b c), fn x ->
fn -> IO.puts("Executing #{x}") end
end) |> Task.async_stream(& &1.())
Task.start(Stream, :run, [stream])
In Elixir 1.12, this executes Stream.start/1
in a task, resulting in the output:
{:ok, #PID<0.133.0>}
Executing a
Executing b
Executing c
iex(12)>
However, in 1.13, the same code results in a timeout error:
15:13:36.087 [error] Task #PID<0.174.0> started from #PID<0.110.0> terminating
** (stop) exited in: Task.Supervised.stream(5000)
** (EXIT) time out
(elixir 1.13.0) lib/task/supervised.ex:295: Task.Supervised.stream_reduce/7
(elixir 1.13.0) lib/stream.ex:649: Stream.run/1
I am probably doing something illegal here?