So here’s something I’ve been puzzling over. We have the result of
Task.Supervisor.async_stream_nolink(Sup, , &foo/1) piping into
Enum.flat_map. I think my specific question would pertain to any use of the
I understand if I pass
ordered: true to
async_stream_nolink the results will feed into
Enum.flat_map in order, and if I pass
ordered: false they will feed in in the order the spawned processes complete.
Behind the scenes, what is happening to these processes spawned by
ordered is true or false? My assumption was that, regardless of what I pass for the
ordered option, all tasks will need to complete before
Enum.flat_map begins doing work. So in either case, things will need to buffer.
Is that true? In this specific scenario, is there any difference in terms of computation, memory usage, or process lifetime when I pass ordered: true or false?
We previously were using ordered: false, but recently have a need for ordered: true, and we’re trying to figure out if there are any consequences related to computation speed or memory.
I’ve walked through the Elixir codebase and docs a fair amount trying to find an answer but didn’t manage to piece it together myself.
I also know this is kind of a hard question to express, so I can certainly try to clarify or rephrase