about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-08-06 01:58:47 +0000
committerEric Wong <e@80x24.org>2016-08-06 02:03:36 +0000
commitd9732203aa53d1fd7b3ba5fae415d3ac003937a0 (patch)
tree57e4139dfbd93fd1c864a016893eb0264864aa47
parentb478f5be70f5e210347c7692333bb65ad3316f72 (diff)
downloadpublic-inbox-d9732203aa53d1fd7b3ba5fae415d3ac003937a0.tar.gz
At least for public-inbox-httpd, this allows us to avoid having
a client monopolize one event loop tick of the server for too
long.  It hurts throughput for the /all.mbox.gz endpoint, but I
doubt anybody cares and the latency improvement for other
clients would be appreciated.

We already do the same fairness thing for HTML pages.
-rw-r--r--lib/PublicInbox/Mbox.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm
index 1e3de5b0..dc41548b 100644
--- a/lib/PublicInbox/Mbox.pm
+++ b/lib/PublicInbox/Mbox.pm
@@ -138,6 +138,9 @@ sub getline {
                                 ${$self->{buf}} = '';
                                 return $ret;
                         }
+
+                        # be fair to other clients on public-inbox-httpd:
+                        return '';
                 }
                 $res = $self->{cb}->($self->{opts});
                 $self->{msgs} = $res->{msgs};