I already observed that when the second response a...
# coroutines
k
I already observed that when the second response arrived the
isActive
predicate returns
false
but I don't know how to prevent it
d
your channel has been closed too early. you should suspend inside
produce
block. for example with internal channel reader like this:
Copy code
val channel = Channel<List<T>>(Channel.UNLIMITED)
 for (any in channel) {
            offer(any)  // here you cast data outside
        }
and inside your callbacks should use this internal channel:
Copy code
channel.offer(blabla)
or maybe just add
delay(Long.MAX)
to the end of
produce
block. not really sure if it will work