I'm trying to implement running ffmpeg process with timeout without resorting to Ruby's Timeout class or spawning a new Thread with counter inside (that's how streamio-ffmpeg does it and it's error-prone and it feels wrong)
Unfortunately when doing non-blocking reads with nio4r, the size of returned chunks of data is pretty much random. While doing synchronous reads result in block yielding every line, in case of nio4r the polling makes it unpredictable.
Is there a better way or should I just somehow glue together responses when I somehow detect the response is incomplete?