Kroppeb
09/19/2019, 12:51 PMmarstran
09/19/2019, 12:57 PMKroppeb
09/19/2019, 1:04 PMmarstran
09/19/2019, 1:11 PMKroppeb
09/19/2019, 1:11 PMmarstran
09/19/2019, 1:12 PMsuspendCoroutine
function. Check out this article: https://medium.com/@elizarov/callbacks-and-kotlin-flows-2b53aa2525cfPaulius Ruminas
09/19/2019, 1:12 PMKroppeb
09/19/2019, 1:12 PMmarstran
09/19/2019, 1:15 PMsuspend fun ByteChannel.read(): ByteBuffer = suspendCoroutine { continuation ->
read { continuation.resume(it) }
}
Kroppeb
09/19/2019, 1:18 PMmarstran
09/19/2019, 1:49 PMread
isn't suspending, right?readSuspending
?Kroppeb
09/19/2019, 1:50 PMmarstran
09/19/2019, 1:51 PMKroppeb
09/19/2019, 1:51 PMmarstran
09/19/2019, 1:52 PMByteChannel
from?Kroppeb
09/19/2019, 2:04 PMkotlin.coroutines.io.ByteReadChannel#read
Evan R.
09/19/2019, 2:26 PMKroppeb
09/19/2019, 2:34 PMEvan R.
09/19/2019, 2:48 PMread
is a suspending function it will wait until new bytes come into the channel before writing out to the output channel.Colton Idle
09/20/2019, 3:29 AM