From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 4/7] qspawn: add type comments in a few places
Date: Mon, 22 Aug 2022 02:33:43 +0000 [thread overview]
Message-ID: <20220822023346.938859-5-e@80x24.org> (raw)
In-Reply-To: <20220822023346.938859-1-e@80x24.org>
This makes things easier-to-follow in a minimally-typed language.
---
lib/PublicInbox/LeiBlob.pm | 4 ++--
lib/PublicInbox/Qspawn.pm | 13 ++++++-------
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/lib/PublicInbox/LeiBlob.pm b/lib/PublicInbox/LeiBlob.pm
index 004b156c..1692289c 100644
--- a/lib/PublicInbox/LeiBlob.pm
+++ b/lib/PublicInbox/LeiBlob.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# "lei blob $OID" command
@@ -70,7 +70,7 @@ sub do_solve_blob { # via wq_do
} @$git_dirs ],
user_cb => \&solver_user_cb,
uarg => $self,
- # -cur_di, -qsp, -msg => temporary fields for Qspawn callbacks
+ # -cur_di, -msg => temporary fields for Qspawn callbacks
inboxes => [ $self->{lxs}->locals, @rmt ],
}, 'PublicInbox::SolverGit';
local $PublicInbox::DS::in_loop = 0; # waitpid synchronously
diff --git a/lib/PublicInbox/Qspawn.pm b/lib/PublicInbox/Qspawn.pm
index 53d0ad55..79db9e76 100644
--- a/lib/PublicInbox/Qspawn.pm
+++ b/lib/PublicInbox/Qspawn.pm
@@ -132,7 +132,7 @@ sub start ($$$) {
sub psgi_qx_init_cb {
my ($self) = @_;
- my $async = delete $self->{async};
+ my $async = delete $self->{async}; # PublicInbox::HTTPD::Async
my ($r, $buf);
my $qx_fh = $self->{qx_fh};
reread:
@@ -227,11 +227,10 @@ sub psgi_return_init_cb {
PublicInbox::GzipFilter::qsp_maybe($r->[1], $env);
my $wcb = delete $env->{'qspawn.wcb'};
- my $async = delete $self->{async};
+ my $async = delete $self->{async}; # PublicInbox::HTTPD::Async
if (scalar(@$r) == 3) { # error
- if ($async) {
- # calls rpipe->close && ->event_step
- $async->close;
+ if ($async) { # calls rpipe->close && ->event_step
+ $async->close; # PublicInbox::HTTPD::Async::close
} else {
$self->{rpipe}->close;
event_step($self);
@@ -255,9 +254,9 @@ sub psgi_return_init_cb {
sub psgi_return_start { # may run later, much later...
my ($self) = @_;
- if (my $async = $self->{psgi_env}->{'pi-httpd.async'}) {
+ if (my $cb = $self->{psgi_env}->{'pi-httpd.async'}) {
# PublicInbox::HTTPD::Async->new(rpipe, $cb, $cb_arg, $end_obj)
- $self->{async} = $async->($self->{rpipe},
+ $self->{async} = $cb->($self->{rpipe},
\&psgi_return_init_cb, $self, $self);
} else { # generic PSGI
psgi_return_init_cb($self) while $self->{parse_hdr};
next prev parent reply other threads:[~2022-08-22 2:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-22 2:33 [PATCH 0/7] an even bigger git show than before Eric Wong
2022-08-22 2:33 ` [PATCH 1/7] config: fix confusing space in ->repo_objs Eric Wong
2022-08-22 2:33 ` [PATCH 2/7] xt/solver: improve diagnostics Eric Wong
2022-08-22 2:33 ` [PATCH 3/7] www: /s/: 404 for unconfigured coderepos Eric Wong
2022-08-22 2:33 ` Eric Wong [this message]
2022-08-22 2:33 ` [PATCH 5/7] qspawn: improve error reporting and handling Eric Wong
2022-08-22 2:33 ` [PATCH 6/7] viewvcs: drop pointless variable assignment Eric Wong
2022-08-22 2:33 ` [PATCH 7/7] viewvcs: start improving display of git commits Eric Wong
2022-08-22 6:44 ` [PATCH 8/7] viewvcs: use :utf8 for opening patch, too Eric Wong
2022-08-22 19:34 ` extindex for git? [was: an even bigger git show than before...] Eric Wong
2022-08-25 21:34 ` Eric Wong
2022-08-26 16:51 ` Konstantin Ryabitsev
2022-08-26 18:11 ` Eric Wong
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://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220822023346.938859-5-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.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.
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).