https://kotlinlang.org logo
#coroutines
Title
# coroutines
j

jimn

12/09/2019, 9:35 PM
how does one simultaneously iterate on multiple flows in the same loop to get the same index? without calling toList() first
e

elizarov

12/09/2019, 9:39 PM
zip
j

jimn

12/09/2019, 9:39 PM
for 1000 flows?
e

elizarov

12/09/2019, 9:40 PM
Why not. But what’s the use-case?
j

jimn

12/09/2019, 9:40 PM
im doing group by key..n, list<value...>
e

elizarov

12/09/2019, 9:41 PM
How you ended up with 1000 identically indexed flows?
j

jimn

12/09/2019, 9:41 PM
mmap
fixed width files with .. obviosly fixed columns
e

elizarov

12/09/2019, 9:41 PM
Why would you need flows here? It is totally synchronous
j

jimn

12/09/2019, 9:44 PM
the syncronous code works to n rows but im trying to switch out Array<Any?> with Flow<Any?> in a few places to remedy heap explosion in the intermediaries
e

elizarov

12/09/2019, 9:44 PM
Use sequence
j

jimn

12/09/2019, 9:44 PM
and GroupBy is actually converting Array<T> to Array<Array<T>>
does flow->sequence->iterator violate any principals or is it just waiting to gel ? my impression is that sqeuences are going to make multiprocessing slightly more mental accounting than calling flatMapMerge
with the exception of zip i see no other multiple flow collector that acts like a latch syncronizer
the idea started as having n cores spaced at 2GB intervals to cleanly divide source decoders at the bottom of the draw-thru driver layer.
5 Views