Part of the "make readable streams not terrible" project in Node.
18:24 <@isaacs> piscisaureus: how hard would it be to implement read(n, cb) in
libuv? in terms of days/weeks of work, etc.?
18:24 <@isaacs> any rough guess?
18:29 <@piscisaureus> isaacs: *shrug*, not much I suppose
18:29 <@piscisaureus> isaacs: it'd be uv_read_start, basically, but without
queuing a new read after reading
18:30 <@piscisaureus> you'd have to ask bnoordhuis for the unix details, but I
think we would have to remove the socket fd from the
poll set after a read returns. Which is also not that hard.
18:32 <@piscisaureus> uv_read(uv_handle_t*, uv_req_t*, size_t n, uv_alloc_cb
on_alloc, uv_read_cb on_read)
18:32 <@piscisaureus> ^— indutny ?
18:32 <@piscisaureus> ^— other libuv users?
uv_err_t uv_read(uv_handle_t*, uv_req_t*, size_t n, uv_alloc_cb on_alloc, uv_read_cb on_read);
LGTM. Obviously this is not going to guarantee a read of n -- just at most n.
Why the uv_err_t return type?
dead socket, etc
Isn't the usual to return -1 and use uv_last_error to get the error?
Closing old stalled issues, please reopen at https://github.com/libuv/libuv if still needed.