R
Robert Klemme
Mikael Brockman said:I agree. What I find inelegant is threads with non-blocking I/O and
Definitely.
kludges like splitting the data into several system calls.
Your example is quite special. Usually, when writing servers that serve
huge chunks of data (like HTTP servers that also serve binary content, e.g.
for download) then the usual (and proper) approach is to copy the file in
chunks. Nobody writes a server that reads a 1GB file into memory first
before sending it over the line. So IMHO your test case is a bit
artificial.
Or put another way round: if there was a need for select like IO handling in
Ruby, then I'd assume someone would have come up with a similar solution
already. I don't know such a solution - so probably nobody did feel the
need yet.
Kind regards
robert