lib/PublicInbox/LEI.pm | 11 ++++++----- lib/PublicInbox/LeiConvert.pm | 4 +--- lib/PublicInbox/LeiP2q.pm | 4 +--- diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 0bd52a469925041995bb3d09d2e2e3d42815cf94..1e720b892221528740d893447db71845fc57ed0a 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -481,12 +481,13 @@ sub workers_start { my ($lei, $wq, $ident, $jobs, $ops) = @_; $ops = { - '!' => [ $lei->can('fail_handler'), $lei ], - '|' => [ $lei->can('sigpipe_handler'), $lei ], - 'x_it' => [ $lei->can('x_it'), $lei ], - 'child_error' => [ $lei->can('child_error'), $lei ], - %$ops + '!' => [ \&fail_handler, $lei ], + '|' => [ \&sigpipe_handler, $lei ], + 'x_it' => [ \&x_it, $lei ], + 'child_error' => [ \&child_error, $lei ], + ($ops ? %$ops : ()), }; + $ops->{''} //= [ \&dclose, $lei ]; require PublicInbox::PktOp; ($lei->{pkt_op_c}, $lei->{pkt_op_p}) = PublicInbox::PktOp->pair($ops); $wq->wq_workers_start($ident, $jobs, $lei->oldset, { lei => $lei }); diff --git a/lib/PublicInbox/LeiConvert.pm b/lib/PublicInbox/LeiConvert.pm index 0aa1322997fb8381ae34c132b6f1ade02b0f598f..8685c194263031739ad0f2dd7c449811b948305f 100644 --- a/lib/PublicInbox/LeiConvert.pm +++ b/lib/PublicInbox/LeiConvert.pm @@ -87,9 +87,7 @@ $lei->{l2m} or return $lei->fail("output not specified or is not a mail destination"); $lei->{opt}->{augment} = 1 unless $ovv->{dst} eq '/dev/stdout'; $self->prepare_inputs($lei, \@inputs) or return; - my $op = $lei->workers_start($self, 'lei_convert', 1, { - '' => [ $lei->can('dclose'), $lei ] - }); + my $op = $lei->workers_start($self, 'lei_convert', 1); $self->wq_io_do('do_convert', []); $self->wq_close(1); while ($op && $op->{sock}) { $op->event_step } diff --git a/lib/PublicInbox/LeiP2q.pm b/lib/PublicInbox/LeiP2q.pm index 302d786492368c65f2c6f8cce5b09551e79820e4..4abe1345d041336a723e9651f7acf2a4ceac1646 100644 --- a/lib/PublicInbox/LeiP2q.pm +++ b/lib/PublicInbox/LeiP2q.pm @@ -182,9 +182,7 @@ $self->{0} = delete $lei->{0}; # guard from lei_atfork_child } else { $self->{input} = $input; } - my $op = $lei->workers_start($self, 'lei patch2query', 1, { - '' => [ $lei->{p2q_done} // $lei->can('dclose'), $lei ] - }); + my $op = $lei->workers_start($self, 'lei patch2query', 1); $self->wq_io_do('do_p2q', []); $self->wq_close(1); while ($op && $op->{sock}) { $op->event_step }