Files | Admin

Notes:

Release Name: 2.5.0

Notes:
kgio 2.5.0 - a minor feature update

kgio provides non-blocking I/O methods for Ruby without raising
exceptions on EAGAIN and EINPROGRESS.  It is intended for use with the
Unicorn and Rainbows! Rack servers, but may be used by other
applications (that run on Unix-like platforms).

* http://bogomips.org/kgio/
* kgio@librelist.org
* git://bogomips.org/kgio.git

Changes:

* Kgio::File.tryopen method added.  It is like File.open
  but won't raise exceptions.  The Kgio::File class includes
  Kgio::PipeMethods, so FIFOs opened through this get the
  kgio_* API.

* The kgio_wait_*able methods in Kgio::DefaultWaiters
  now accept an optional timeout argument.



Changes: .document | 1 + GIT-VERSION-GEN | 2 +- HACKING | 2 +- ISSUES | 4 +- README | 11 +-- ext/kgio/accept.c | 2 + ext/kgio/ancient_ruby.h | 3 +- ext/kgio/autopush.c | 5 +- ext/kgio/connect.c | 1 - ext/kgio/extconf.rb | 6 ++ ext/kgio/kgio.h | 3 +- ext/kgio/kgio_ext.c | 1 + ext/kgio/poll.c | 1 + ext/kgio/read_write.c | 9 ++- ext/kgio/set_file_path.h | 26 +++++++ ext/kgio/tryopen.c | 181 +++++++++++++++++++++++++++++++++++++++++++++ ext/kgio/wait.c | 98 +++++++++++++++++------- pkg.mk | 6 +- test/test_default_wait.rb | 24 ++++++ test/test_tryopen.rb | 81 ++++++++++++++++++++ 20 files changed, 415 insertions(+), 52 deletions(-) commit e720827b48c3318627d1471ad4ec90d6166520fd Author: Eric Wong Date: Fri Jun 17 19:01:06 2011 -0700 doc: update documentation for kgio_addr attribute We support IPv6, not just IPv4 commit ce08273658b14dc3d53273b514e46b6e65882bf6 Author: Eric Wong Date: Fri Jun 17 18:35:38 2011 -0700 doc: call-seq for kgio_wait_writable It's there for kgio_wait_readable commit 72ab71667b2a9c27d1eda73aacb8b86187f317d0 Author: Eric Wong Date: Fri Jun 17 18:10:44 2011 -0700 ancient_ruby.h: avoid symbol clobbering In case the toolchain can't test the feature properly or Ruby is upgraded and the symbol is added. commit 079f9227dce2e69bd3460c783e12fa05c687b7d3 Author: Eric Wong Date: Wed Jun 15 22:16:15 2011 -0700 fix misc compiler warnings Some installations of Ruby clobbered my usual CFLAGS=-Wall commit 8fe21f6758bb877efacce1fa6573e72625252585 Author: Eric Wong Date: Wed Jun 15 08:30:03 2011 +0000 make timed kgio_wait_* implementation safer IO.select can handle fd >= 1024 safely in some Rubies while fd_set may not. We could use rb_thread_fd_select(), but rb_wait_for_single_fd() is available now so the former is not worth the maintenance hassle. commit 9159f70862e3e6a76d821c4a70bc68a603793a49 Author: Eric Wong Date: Wed Jun 15 02:39:13 2011 +0000 Kgio::File includes Kgio::PipeMethods module Kgio::File may be used to open FIFOs, so non-blocking I/O is still useful in that context. commit 6d6f704e29d7bf1e95f1c9c60cbab82ec3d430d2 Author: Eric Wong Date: Wed Jun 15 02:34:49 2011 +0000 Kgio::File.tryopen runs GC on ENOMEM It is possible but unlikely to get ENOMEM on open(2), so try to GC away some files. commit e693b871567119345c2c567bfa2ad46e210d655b Author: Eric Wong Date: Wed Jun 15 02:27:06 2011 +0000 doc: add rdoc for Kgio::File.tryopen New feature in 2.5, we now have 100% documentation again. commit 5550222b389c2971ee98bdd62c749ce228efda06 Author: Eric Wong Date: Wed Jun 15 02:12:31 2011 +0000 kgio_wait_*able: documentation for optional timeout New features are better if they're documentated. commit 3fe0ad91d7a81a84ecc9e75ba8f5162bad30b2ac Author: Eric Wong Date: Wed Jun 15 02:06:32 2011 +0000 doc: use librelist.org instead of librelist.com Non-profit TLD is better sounding for a Free Software project. commit 2e20f8b1a1b74ae5442e44de70196a5e3121c642 Author: Eric Wong Date: Wed Jun 15 02:04:00 2011 +0000 GIT-VERSION-GEN: bump version for new API commit aa9594b0d38b012729a46fd519fcc369600f4c3e Merge: bbf9a3b fdde0a2 Author: Eric Wong Date: Wed Jun 15 02:05:43 2011 +0000 Merge branch '2.4-stable' * 2.4-stable: kgio 2.4.2 - OpenSolaris build fix extconf: -lnsl and -lsocket checks for OpenSolaris commit bbf9a3bc0ca2d91705e27ad8bfb5c0ed9651a2ef Author: Eric Wong Date: Tue Jun 14 08:41:32 2011 +0000 add timeout to kgio_wait_{read,writ}able io/wait doesn't have an IO#wait_writable method, yet[1] and IO#wait checks FIONREAD which makes it unsuitable for certain descriptors. This method uses the new rb_wait_for_single_fd() function in Ruby 1.9.r. This internally uses ppoll() under Linux, meaning it performs the same regardless of the FD used. [1] http://redmine.ruby-lang.org/issues/4647 [2] http://redmine.ruby-lang.org/issues/4849 commit d224563823accca63fd871260e3f0dad6758c8d4 Author: Eric Wong Date: Mon Jun 13 14:26:10 2011 -0700 extconf: -lnsl and -lsocket checks for OpenSolaris Reported via private email. commit 83c6584be53d6863e647067ba385b42ed5347cdb Author: Eric Wong Date: Mon May 23 11:28:29 2011 -0700 README: clarify that we only work on Unix-like systems We won't waste time with inferior, non-Free platforms. commit 2ade0059c67a0ae4fa1b416c500169e3ac66bfff Author: Eric Wong Date: Fri May 20 20:00:15 2011 -0700 pkg.mk: update to the latest version Fixes locale issues with grep and adds check-warnings commit 8184059bf16d73f0a386ddbf68c4949d1dec3bdf Merge: a5357ad f656c49 Author: Eric Wong Date: Fri May 20 19:54:48 2011 -0700 Merge branch '2.4-stable' * 2.4-stable: kgio 2.4.1 - Kgio.poll avoids EINTR, really Kgio.poll: ensure EINTR never gets raised commit a5357ad014d2eacc99dd7ee46040686cbf1d871c Author: Eric Wong Date: Fri May 20 19:50:34 2011 -0700 Kgio.poll: ensure EINTR never gets raised Retry on a zero timeout if we get interrupted even if the timeout expired. This is also what IO.select does in Ruby itself. commit 605765ded31c784727077dfca573092ba725f717 Author: Eric Wong Date: Fri May 13 17:57:10 2011 -0700 Kgio.tryopen => Kgio::File.tryopen This will allow users to subclass Kgio::File and override certain behavior (e.g. overriding "#each"). commit c8bd876fb5086e5b79299869b4c29f1f7f020b4d Author: Eric Wong Date: Fri May 13 17:48:56 2011 -0700 return Kgio::File for Kgio.tryopen This also allows us to return/override #to_path and #path if necessary, but so far everything works with MRI 1.8, MRI 1.9, and Rubinius. commit 6cefcff5889cceaa001f76f4be1a1c5e513b241d Author: Eric Wong Date: Fri May 13 15:55:50 2011 -0700 add Kgio.tryopen method For the case where a file is readable, it's faster to just call open() instead of stat()-ing and then calling open(). open() failures are still relatively cheap, too, they're still more expensive than a failed stat() but cheaper than raising an exception.