Rainbows! Rack HTTP server user/dev discussion
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [ANN] Rainbows! 4.4.3 - bugfixes for EventMachine users
@ 2013-01-18 11:31  6% Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2013-01-18 11:31 UTC (permalink / raw)
  To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw

Changes:

This release contains bugfixes from Lin Jen-Shin and Mark J. Titorenko
for EventMachine.  There are also some minor cleanups.

Lin Jen-Shin (1):
      event_machine: avoid close on deferred response

Mark J. Titorenko (1):
      event_machine: join reactor_thread if it is already running

Eric Wong (2):
      event_machine: cleanup confusing assignment
      t/GNUmakefile: cleanup test dependencies

* http://rainbows.rubyforge.org/
* rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
* git://bogomips.org/rainbows.git
* http://rainbows.rubyforge.org/NEWS.atom.xml

-- 
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


^ permalink raw reply	[relevance 6%]

* Re: [PATCH] close_connection_after_writing only if not deferred, as in cool.io
       [not found]         ` <CAA2_N1scEcW3J=4dmUVvd+UgLwuayqkpfjNfVGLCJw-dXm9_cA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-12-18 21:45  7%       ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2012-12-18 21:45 UTC (permalink / raw)
  To: Rainbows! list

"Lin Jen-Shin (godfat)" <godfat-hOE/xeEBYYIdnm+yROfE0A@public.gmane.org> wrote:
> I don't have 100% confidence about this,
> but running test suite "t/t0002-graceful.sh"
> during my development for EventMachineThreadPool

Heh, I gave that a shot way back in the day but never got it working
to my satisfaction.  Perhaps your fix is what is needed...

> would need this to properly pass the tests.
> 
> I think this would be needed while using
> `throw :async' as well?

I don't think so, you just need to set @deferred=nil in a few places
before calling quit.

I've updated the patch and commit message.  Will apply unless
you have objections:

--------------------------------8<----------------------------------

>From 42bf1f6de55b82af46fd8255453036c6582b7f19 Mon Sep 17 00:00:00 2001
From: Lin Jen-Shin <godfat-hOE/xeEBYYIdnm+yROfE0A@public.gmane.org>
Date: Wed, 19 Dec 2012 04:03:55 +0800
Subject: [PATCH] event_machine: avoid close on deferred response

close_connection_after_writing only if not deferred, as in
cool.io

Deferred responses may buffer more data down the line, so
keep the connection alive if we have a deferred response
body.

[ew: clear @deferred when we really want to quit,
 updated commit message]

Acked-by: Eric Wong <normalperson-rMlxZR9MS24@public.gmane.org>
---
 lib/rainbows/event_machine/client.rb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/rainbows/event_machine/client.rb b/lib/rainbows/event_machine/client.rb
index fc0dfe3..f3c2070 100644
--- a/lib/rainbows/event_machine/client.rb
+++ b/lib/rainbows/event_machine/client.rb
@@ -28,7 +28,7 @@ class Rainbows::EventMachine::Client < EM::Connection
 
   def quit
     super
-    close_connection_after_writing
+    close_connection_after_writing if nil == @deferred
   end
 
   def app_call input
@@ -48,6 +48,7 @@ class Rainbows::EventMachine::Client < EM::Connection
   def deferred_errback(orig_body)
     @deferred.errback do
       orig_body.close if orig_body.respond_to?(:close)
+      @deferred = nil
       quit
     end
   end
@@ -103,7 +104,8 @@ class Rainbows::EventMachine::Client < EM::Connection
 
   def next!
     @deferred.close if @deferred.respond_to?(:close)
-    @hp.keepalive? ? receive_data(@deferred = nil) : quit
+    @deferred = nil
+    @hp.keepalive? ? receive_data(nil) : quit
   end
 
   def unbind
-- 
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


^ permalink raw reply related	[relevance 7%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
     [not found]     <CAA2_N1tHbvs=J--dPZLnq6_owEx3JJZbFoRzjFKcCLBONW=iGA@mail.gmail.com>
     [not found]     ` <CAA2_N1s+SefHd7Dotw53+5b=-EeBt_O5Q-LmoKuUy65jZiZ+tA@mail.gmail.com>
2012-12-18 20:36       ` [PATCH] close_connection_after_writing only if not deferred, as in cool.io Lin Jen-Shin (godfat)
     [not found]         ` <CAA2_N1scEcW3J=4dmUVvd+UgLwuayqkpfjNfVGLCJw-dXm9_cA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-18 21:45  7%       ` Eric Wong
2013-01-18 11:31  6% [ANN] Rainbows! 4.4.3 - bugfixes for EventMachine users Eric Wong

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).