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, MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.io-splice.general Subject: [RFC] try* interfaces in io_splice 2.2.0.18.g3025 Date: Mon, 28 Feb 2011 01:19:50 +0000 Message-ID: <20110228011950.GA31141@dcvr.yhbt.net> References: <20110228011950.GA31141@dcvr.yhbt.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1298856010 16392 80.91.229.12 (28 Feb 2011 01:20:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 Feb 2011 01:20:10 +0000 (UTC) To: ruby.io.splice@librelist.com Original-X-From: ruby.io.splice@librelist.com Mon Feb 28 02:20:03 2011 Return-path: Envelope-to: gclrig-ruby.io.splice@m.gmane.org In-Reply-To: <20110228011950.GA31141@dcvr.yhbt.net> List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Precedence: list Original-Sender: ruby.io.splice@librelist.com Xref: news.gmane.org gmane.comp.lang.ruby.io-splice.general:24 Archived-At: Received: from zedshaw.xen.prgmr.com ([64.71.167.205]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PtrmN-0002zr-9y for gclrig-ruby.io.splice@m.gmane.org; Mon, 28 Feb 2011 02:20:03 +0100 Received: from zedshaw.xen.prgmr.com (localhost [IPv6:::1]) by zedshaw.xen.prgmr.com (Postfix) with ESMTP id E5CB021C4F9 for ; Mon, 28 Feb 2011 01:19:57 +0000 (UTC) $ gem install --pre io_splice It's also up at git://bogomips.org/ruby_io_splice.git in master. This adds IO.trytee and IO.trysplice which behave like their non-trying counterparts with the following exceptions: 1) IO::Splice::F_NONBLOCK is implied/forced. IO.trysplice may still block if the non-pipe descriptor blocks, so users should always set non-blocking on that descriptor. 2) Unlike the established Kgio, this returns :EAGAIN instead of :wait_readable or :wait_writable. This is because only the user of the code can tell which descriptor is actually full/empty. There is no IO.tryvmsplice, I haven't figured out if IO.vmsplice is useful or not and non-blocking I/O with iovecs is so painful to deal with it's not worth it. The flags argument of all these interfaces is now optional and will default to zero (and IO::Splice::F_NONBLOCK for IO.try{splice,tee}). -- Eric Wong