First of all, it really obscures the intent. The idea there is pretty
simple -- get items from all flow nodes (they are Streams). However,
the amount of ceremony around futures/streams really obscurs this idea.
Secondly, the current approach has two dubious unwraps in Deref and
DerefMut for scheduler::FlowNode. That's not great.
Lastly, but not least importantly, returning that Next structure
involves a non-zero amount of allocation / copying, which isn't great
either.
Solution: use StreamUnorderded to convey the intent and to optimize resources
First of all, it really obscures the intent. The idea there is pretty simple -- get items from all flow nodes (they are
Stream
s). However, the amount of ceremony around futures/streams really obscurs this idea.Secondly, the current approach has two dubious
unwrap
s inDeref
andDerefMut
forscheduler::FlowNode
. That's not great.Lastly, but not least importantly, returning that
Next
structure involves a non-zero amount of allocation / copying, which isn't great either.Solution: use StreamUnorderded to convey the intent and to optimize resources