Looks like `ReceiveChannel.last()` is deprecated, ...
# coroutines
k
Looks like
ReceiveChannel.last()
is deprecated, it links to https://github.com/Kotlin/kotlinx.coroutines/issues/254 but what do I actually have to replace it by?
d
How is your
ReceiveChannel
being created? You might be able to replace it with
Flow
. (Although you'd be moving from deprecated warnings to some experimental warnings lol).
k
It's basically a bunch of objects that have an input and an output channel and they're connected in a cyclic graph, and I want to get the last output of one of them.
d
Hmm, cycle, sounds naughty.... I guess you could do
.consumeAsFlow().last()
.
k
Sounds like the amplifier problem for aoc =)
k
What a coincidence 🙂