]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WwwStream.pm
www: rework async_* to use method table
[public-inbox.git] / lib / PublicInbox / WwwStream.pm
index 7d257a191b0dda96558f969cc1b45d693f726942..d79770ed1d82b8dbd484ca84dbf445962116bef8 100644 (file)
@@ -1,11 +1,10 @@
 # Copyright (C) 2016-2020 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 #
-# HTML body stream for which yields getline+close methods
+# HTML body stream for which yields getline+close methods for
+# generic PSGI servers and callbacks for public-inbox-httpd.
 #
-# public-inbox-httpd favors "getline" response bodies to take a
-# "pull"-based approach to feeding slow clients (as opposed to a
-# more common "push" model)
+# See PublicInbox::GzipFilter parent class for more info.
 package PublicInbox::WwwStream;
 use strict;
 use parent qw(Exporter PublicInbox::GzipFilter);
@@ -29,7 +28,7 @@ sub init {
        bless $ctx, __PACKAGE__;
 }
 
-sub async_eml { # ->{async_eml} for async_blob_cb
+sub async_eml { # for async_blob_cb
        my ($ctx, $eml) = @_;
        $ctx->{http_out}->write($ctx->translate($ctx->{cb}->($ctx, $eml)));
 }
@@ -199,7 +198,7 @@ sub aresponse {
        my ($ctx, $code, $cb) = @_;
        my $res_hdr = [ 'Content-Type' => 'text/html; charset=UTF-8' ];
        init($ctx, $cb);
-       $ctx->psgi_response($code, $res_hdr, \&async_next, \&async_eml);
+       $ctx->psgi_response($code, $res_hdr);
 }
 
 1;