smol icon indicating copy to clipboard operation
smol copied to clipboard

Make the documentation of Async::new explicit on the fact that it does not support regular files?

Open Ekleog opened this issue 3 years ago • 2 comments

Hey! I just got tricked by #61, and checking the documentation wasn't that helpful: I was thinking that smol somehow had some kind of dark magic to make it work even though it was a file.

Reading #61 I understood what was wrong in my code (and I have been able to easily replace smol::Async with smol::Unblock), but to get to it I had to strace my process and figure out that the “permission denied” that was reported was due to epoll_ctl failing.

Hence, a suggestion: what would you think about making the documentation for Async::new and Unblock::new point to each other so people cannot miss the fact that the two exist and each cover their own ground?

Ekleog avatar Dec 24 '20 19:12 Ekleog

Would you like to make a small PR for it? 😃

shekohex avatar Jan 16 '21 19:01 shekohex

a small smol PR would be appreciated

rtyler avatar Jan 16 '21 19:01 rtyler

The documentation for Async now says:

However, do not use Async with types like File, Stdin, Stdout, or Stderr because all operating systems have issues with them when put in non-blocking mode.

This seems explicit enough to me.

notgull avatar May 15 '23 21:05 notgull