https://kotlinlang.org logo
d

Deactivated User

12/24/2016, 5:03 PM
Copy code
fun readStream() = asyncGenerate {
	while (true) {
		val ba: Any = ___read(1)
		println("Read: $ba")
		val c: Any = (ba as ByteArray)[0]
		yield(c)
	}
}
println is executed before __read method has produced any result