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: AS14383 205.234.109.0/24 X-Spam-Status: No, score=1.0 required=3.0 tests=AWL,HK_RANDOM_FROM, MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=no version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.rainbows.general Subject: Re: [RFC/PATCH] event_machine: lazily set async env keys Date: Thu, 15 Jul 2010 21:05:30 +0000 Message-ID: <20100715210530.GA30751@dcvr.yhbt.net> References: <20100715060338.GA2561@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 1279228523 24863 80.91.229.12 (15 Jul 2010 21:15:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 15 Jul 2010 21:15:23 +0000 (UTC) To: Rainbows! list Original-X-From: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Thu Jul 15 23:15:22 2010 Return-path: Envelope-to: gclrrg-rainbows-talk@m.gmane.org X-Original-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Delivered-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Errors-To: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Xref: news.gmane.org gmane.comp.lang.ruby.rainbows.general:103 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OZVm5-0005Of-Md for gclrrg-rainbows-talk@m.gmane.org; Thu, 15 Jul 2010 23:15:21 +0200 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 752B31858346; Thu, 15 Jul 2010 17:15:14 -0400 (EDT) Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by rubyforge.org (Postfix) with ESMTP id E27741858375 for ; Thu, 15 Jul 2010 17:05:31 -0400 (EDT) Received: from localhost (unknown [127.0.2.5]) by dcvr.yhbt.net (Postfix) with ESMTP id 3383B1F503; Thu, 15 Jul 2010 21:05:31 +0000 (UTC) James Tucker wrote: > On 15 Jul 2010, at 07:03, Eric Wong wrote: > > > This has the small likelyhood of breaking apps that > > check via: > > env.include?("async.callback") > > > > Or any of member?/has_key?/key?, as they're all the same method. > Just regarding the async close, it's used primarily when the client > disconnects so that you can stop asynchronous operations. It's quite > important from a resource standpoint. OK, but the EM::DefaultDeferrable object is never touched (or even instantiated), then there's no need to close it. > Why don't you just use a lambda instead of a method? > > lambda { |*args| em_write_response(*args) } > > That'd avoid the leak, and provide nearly the same performance > profile. In fact on 1.9, lambdas are pretty damn quick. Durr... I didn't think of that :x Since 1.9.2 is in RC with few users and this bug has a fix (at http://redmine.ruby-lang.org/issues/show/3466), we might as well leave the code as-is for now and skip my proposed patch. Any objections? I try to avoid working around other projects' bugs (and just helping fix them). This is especially the case for things like 1.9.2 which is still in the very early stages of adoption. -- Eric Wong _______________________________________________ Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org http://rubyforge.org/mailman/listinfo/rainbows-talk Do not quote signatures (like this one) or top post when replying