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

louiscad

08/24/2018, 6:23 PM
@withoutclass Always use
consume
or
consumeEach
. BTW, this is getting me wondering if
for
loop on a channel without
consumption
should raise a warning…
☝️ 1
b

bj0

08/24/2018, 6:25 PM
what about in an actor?
i was talking about the internal channel, since you close it from outside, and you typically loop on it until it's closed so
consume
is probably redundant
l

louiscad

08/24/2018, 6:33 PM
Yes, that's what I understood, and I think you're right about this case (which may be reproduced in some cases)
b

bj0

08/24/2018, 6:34 PM
i have parsing code that uses
for
without
consume
, though it has no way to break out of the
for
except an external close, so that would be the same case I guess
4 Views