Rainbows! Rack HTTP server user/dev discussion
 help / color / mirror / code / Atom feed
From: James Tucker <jftucker-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Rainbows! list <rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org>
Subject: Re: [RFC/PATCH] event_machine: lazily set async env keys
Date: Thu, 15 Jul 2010 22:43:06 +0100	[thread overview]
Message-ID: <AFF9D5AF-FAD0-48D9-907E-059E92077BA6@gmail.com> (raw)
In-Reply-To: <20100715210530.GA30751-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>


On 15 Jul 2010, at 22:05, Eric Wong wrote:

> James Tucker <jftucker-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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.

I have a similar patchset i'm not putting in for Thin. Also, the EM adjustment I made merely reduces the impact, and also increases performance:

http://github.com/eventmachine/eventmachine/commit/60b6472da952c7cdc59f093f93678dbd1739ab0a

_______________________________________________
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


      parent reply	other threads:[~2010-07-15 21:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-15  6:03 [RFC/PATCH] event_machine: lazily set async env keys Eric Wong
     [not found] ` <20100715060338.GA2561-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2010-07-15 14:22   ` James Tucker
     [not found]     ` <DC95175B-4AD7-452C-9F81-F87F922B9A85-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-07-15 21:05       ` Eric Wong
     [not found]         ` <20100715210530.GA30751-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2010-07-15 21:43           ` James Tucker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/rainbows/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AFF9D5AF-FAD0-48D9-907E-059E92077BA6@gmail.com \
    --to=jftucker-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/rainbows.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).