Jakub Gwóźdź
12/13/2019, 11:28 AM.receive()
is explicitly called and b) only after another channel (output from the Intcode) has been completely processed.
I failed to do it, so instead I created a wrapper that does something like
override suspend fun receive(): BigInteger {
while (!output.isEmpty) {
val x = output.receive()
// ... process x
}
return something
}
But I think I'm missing some point here and it could be more elegantJoris PZ
12/13/2019, 1:54 PMKroppeb
12/13/2019, 3:15 PMJoris PZ
12/13/2019, 4:41 PMJakub Gwóźdź
12/15/2019, 6:29 AMJoris PZ
12/15/2019, 12:07 PMFlow
instead of Channel
for exactly this reason, as they are essentially suspending sequences and should be able to lazily calculate the input at the time it was requested. But I struggled to come up with a working design and so went back to Channels. Would be an interesting thing to refactor to in the future