Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Newbie taking a serious look at Rust here.

Any notes about non-blocking I/O in rust? Iron [1] is mentioned, but am not sure how I/O is handled in Iron yet .. or how it would be written to be non-blocking [2]. I hear "read the source luke" echoing in the chambers of HN and will do that, but some higher level info would be nice.

[1] http://ironframework.io/

[2] http://www.reddit.com/r/rust/comments/1v2ptr/is_nonblocking_...

edit: This (http://doc.rust-lang.org/native/io/) seems to suggest that the norm is non-blocking I/O which is automatically handled by the scheduler.



If you explicitly use the "green" runtime that ships with rust instead of the "native" runtime, you get green threads where the built-in blocking IO only blocks the green thread but lets the OS-level thread carry on executing other green threads.

Internally that is built on top of libuv for async IO, but as far as I know, Rust currently doesn't expose any interface for manually doing async or nonblocking IO.


It seems this issue was only recently closed (May 9) [1] .. and it seems a websocket library with full duplex support is still in the works.

[1] https://github.com/rust-lang/rust/issues/11165


Thanks for this clarification.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: