Kroppeb
09/19/2019, 12:51 PMKroppeb
09/19/2019, 12:52 PMmarstran
09/19/2019, 12:57 PMKroppeb
09/19/2019, 1:04 PMKroppeb
09/19/2019, 1:05 PMKroppeb
09/19/2019, 1:10 PMKroppeb
09/19/2019, 1:10 PMKroppeb
09/19/2019, 1:10 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 PMKroppeb
09/19/2019, 1:12 PMKroppeb
09/19/2019, 1:13 PMKroppeb
09/19/2019, 1:14 PMKroppeb
09/19/2019, 1:14 PMmarstran
09/19/2019, 1:15 PMsuspend fun ByteChannel.read(): ByteBuffer = suspendCoroutine { continuation ->
read { continuation.resume(it) }
}
Kroppeb
09/19/2019, 1:18 PMKroppeb
09/19/2019, 1:20 PMKroppeb
09/19/2019, 1:35 PMmarstran
09/19/2019, 1:49 PMread
isn't suspending, right?marstran
09/19/2019, 1:49 PMreadSuspending
?Kroppeb
09/19/2019, 1:50 PMmarstran
09/19/2019, 1:51 PMKroppeb
09/19/2019, 1:51 PMmarstran
09/19/2019, 1:52 PMmarstran
09/19/2019, 1:53 PMByteChannel
from?marstran
09/19/2019, 1:55 PMKroppeb
09/19/2019, 2:04 PMkotlin.coroutines.io.ByteReadChannel#read
Evan R.
09/19/2019, 2:26 PMKroppeb
09/19/2019, 2:34 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 AMKroppeb
09/20/2019, 10:24 AM