https://kotlinlang.org logo
#ktor
Title
# ktor
a

Aaron Todd

06/01/2020, 1:41 PM
Is there anyway to be notified when a
ByteReadChannel
has been exhausted (or closed)?
e

e5l

06/01/2020, 1:42 PM
Hi @Aaron Todd, there are no public API for that. You can create wrapper
writer
coroutine with
joinTo
inside and put in finally block the logic you need
a

Aaron Todd

06/01/2020, 1:47 PM
Hey @e5l thanks for the response. Can you elaborate a bit? I'm looking at
joinTo
now but there isn't any documentation on it. Based on the API surface it just looks like it's copying to another channel?
e

e5l

06/01/2020, 1:55 PM
It moves the content from one channel to another
a

Aaron Todd

06/01/2020, 2:00 PM
thanks, I'll see if it satisfies my needs.