From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6939 64.71.128.0/18 X-Spam-Status: No, score=-1.9 required=3.0 tests=AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-source-folder: /home/ew/Mail/a.yhbt/2011-10.mbox.gz Return-Path: X-Original-To: normalperson@yhbt.net Received: from zedshaw.xen.prgmr.com (zedshaw.xen.prgmr.com [64.71.167.205]) by dcvr.yhbt.net (Postfix) with ESMTP id 812041F6A7 for ; Thu, 10 Mar 2011 05:02:10 +0000 (UTC) Received: from zedshaw.xen.prgmr.com (localhost [IPv6:::1]) by zedshaw.xen.prgmr.com (Postfix) with ESMTP id 153AE21C6C5 for ; Thu, 10 Mar 2011 05:02:10 +0000 (UTC) MIME-Version: 1.0 Date: Thu, 10 Mar 2011 05:02:02 +0000 From: Eric Wong In-Reply-To: <20110310050202.GA27160@dcvr.yhbt.net> List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Message-Id: <20110310050202.GA27160@dcvr.yhbt.net> Precedence: list References: <20110310050202.GA27160@dcvr.yhbt.net> Sender: sleepy.penguin@librelist.com Subject: [sleepy.penguin] [ANN] sleepy_penguin 2.0.0 - Linux I/O events for Ruby To: sleepy.penguin@librelist.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit sleepy_penguin provides access to newer, Linux-only system calls to wait on events from traditionally non-I/O sources. Bindings to the eventfd, timerfd, inotify, signalfd and epoll interfaces are provided. * http://bogomips.org/sleepy_penguin/ * sleepy.penguin@librelist.com * git://bogomips.org/sleepy_penguin.git == Disclaimer I've mainly written this to force myself to learn some of the newer APIs in Linux 2.6 but maybe someone will find them useful one day. If you're writing portable software or want something other people use in production, consider Cool.io[1] or EventMachine[2] instead. == Features * Thread-safe blocking operations under both Ruby 1.8 and 1.9. * IO-like objects are backwards-compatible with IO.select. * Epoll interface is fork-safe and GC-safe * Unlike portable event frameworks, the Linux-only Epoll interface allows using edge-triggered I/O for possibly improved performance * Fully-documented and user-friendly API Changes since 1.4.0: There are many internal cleanups, bugfixes, and incompatible API changes. The API will probably be stable from now on. All the flag passing is less verbose, in the past you had to do: tfd = TimerFD.new(TimerFD::CLOEXEC|TimerFD::NONBLOCK) Now, you can just do (the old way still works): tfd = TimerFD.new([:CLOEXEC, :NONBLOCK]) A SignalFD interface now exists, but is not recommended since MRI signal handling seems to conflict with it. Inotify#close no longer holds the GVL while closing the descriptor since it is an expensive operation. See git log v1.4.0..v2.0.0 for all the gory details. [1] - http://coolio.github.com/ [2] - http://rubyeventmachine.com/ -- Eric Wong