--oC1+HKm2/end4ao3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 03, 2011 at 11:03:09PM +0900, Tanaka Akira wrote: > 2011/8/2 Yehuda Katz <wycats / gmail.com>: > > > The current Ruby I/O classes have non-blocking methods (read_nonblock and write_nonblock). These methods will never block, and if they would block, they raise an exception instead (IO::WaitReadable or IO::WaitWritable). In addition, if the IO is at EOF, they raise an EOFError. > > > > These exceptions are raised repeatedly in virtually every use of the non-blocking methods. This patch adds a pair of methods (try_read_nonblock and try_write_nonblock) that have the same semantics as the existing methods,ut they return Symbols instead of raising exceptions for these routine cases: > > I'm neutral about this proposal. > > Although the exceptions are not exceptional, > they are very educational. If the exceptions are not exceptional, that makes me wonder why are they exceptions at all? Since these aren't really exceptional cases, I would prefer not to rescue. As Alex pointed out, these exceptions really make $DEBUG noisy and that also bugs me about the current behavior. -- Aaron Patterson http://tenderlovemaking.com/ --oC1+HKm2/end4ao3 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iQEcBAEBAgAGBQJOOYtDAAoJEJUxcLy0/6/G25sIAIGeZUyfvdlavV6CRc+NSh7d qmjNIC4284htECvwkLRMwrH+sDh4ANS/CZ+yfqOKq3qduTb8jO1BIcPYAce/0Okh RXQ3xjd5STDcA1gDBJNqsgWI9bcHSwBFCIb5nX+b2EwZCc6PEON60hPgrXb3T0Cj LACYnNDno1OlykzSOl1oXV/N/KqO5ttp6Zbd+efpTRgw1Sj9/dl2MUgakS8CREWd J3hyUcDBGLGmOY9ZmgXsFijzUUDVI+Dmxzl6GHZddbjF7/AEX5klj6soUq+eRLgj +HkbB7IT2Ej5k0fXEr3z7yMTOZTnD1AKR6mjAdzfzs/w6Lwdo2IjXhkXsR+VEOEG -----END PGP SIGNATURE----- --oC1+HKm2/end4ao3--