Results 984 comments of Nathaniel J. Smith

As requested by @thedrow (e.g. #931), it would be great to have a simple worked example of wrapping a callback/fd-based C library and adapting it to Trio style, demonstrating `wait_readable`/`wait_writable`....

@thedrow we already have an issue for `sd_notify` and friends – let's discuss that over on #252. This thread is about examples to teach people about trio, and AFAIK there...

Here's a sketch for a web spider, including a tricky solution to figuring out when a circular channel flow is finished: https://gist.github.com/njsmith/432663a79266ece1ec9461df0062098d

Huh! Apparently Linux 4.14 actually added something useful here: https://kernelnewbies.org/Linux_4.14#Asynchronous_buffered_I.2FO_support It's actually pretty sensible: it lets you do a "non-blocking `read`", so if the data is in the buffer cache...

I also just filed [bpo-32561](https://bugs.python.org/issue32561), which would make this MUCH easier for us to use. Edit: Now https://github.com/python/cpython/issues/76742

Yeah, this is tricky. On the one hand, you kind of have to report the failure, b/c "program hangs silently" is terrible UX. On the other hand, you kind of...

> If I got this right the idea would be a change like, moving the try: .. except to `trio._subprocess.run_process.open_process`: You mean `trio._subprocess.run_process.killer`, right? > Also what is a good...

@guilledk In your comment, you had `try`/`except OSError`. For the original version where we were just catching errors from the default `deliver_cancel`, that was fine, because we knew `OSError` was...

Sorry this has been biting you! I'd like to understand better what exactly's happening. I guess it must be something like: * Some code raises an exception * While that's...

I should also say I'm very wary about making a blanket recommendation that people use shielding in any `__aexit__`/`finally` blocks... it might be the best solution for now in your...