y
06/05/2023, 11:36 AMlazynoda
06/05/2023, 11:59 AMlazynoda
06/05/2023, 12:00 PMy
06/05/2023, 12:00 PMy
06/05/2023, 12:01 PMCLOVIS
06/05/2023, 12:02 PMCLOVIS
06/05/2023, 12:02 PMCLOVIS
06/05/2023, 12:02 PMy
06/05/2023, 12:03 PMCLOVIS
06/05/2023, 12:04 PM|
in bash works, the system handles waking up all processes in the chain whenever they receive data / putting to sleep the processes at the start if the next ones can't match the speedy
06/05/2023, 12:08 PMwhile (true) {
val input = generateSequence(::readLine)
if (input.isNotEmpty()) {
process(input)
}
}
just block in the val input
line until input starts, read until input ends, then just go back to blocking on the beginning of the next iteration of the while
?y
06/05/2023, 12:08 PMCLOVIS
06/05/2023, 12:09 PMreadLine
call which doesn't have enough characters to read a full line, is blocked by the OSy
06/05/2023, 12:09 PMCLOVIS
06/05/2023, 12:10 PMCLOVIS
06/05/2023, 12:12 PMCLOVIS
06/05/2023, 12:13 PMCLOVIS
06/05/2023, 12:14 PMy
06/05/2023, 12:17 PMCLOVIS
06/05/2023, 12:19 PMCLOVIS
06/05/2023, 12:23 PMCLOVIS
06/05/2023, 12:24 PMCLOVIS
06/05/2023, 12:25 PMCLOVIS
06/05/2023, 12:26 PMy
06/05/2023, 12:27 PM