JakeWharton / mosaic

Build terminal UI in Kotlin using Jetpack Compose
Apache License 2.0
1.89k stars 57 forks source link

Timeout for `StdinReader.read` #486

Open JakeWharton opened 6 days ago

JakeWharton commented 6 days ago

Normally a timeout-free read is fine. Input comes, you process it, you go back to blocking on read. But in rare cases you may need to do an additional disambiguation read which should not block indefinitely.

Will have to see what Windows supports. select takes secs+micros. pselect takes secs+nanos. I don't see why anyone would need more than 1 second's worth of timeout which is an eternity in CPU time.