From 954581b8e575966a8bddc35e3b23d81d16a52833 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 28 Mar 2021 09:01:13 +0000 Subject: lei: simplify PktOp callers Provide a consistent ->op_wait_event method instead of forcing callers to loop (or not) at each callsite. This also avoid a leak possibility by avoiding circular references. --- lib/PublicInbox/LeiMark.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/LeiMark.pm') diff --git a/lib/PublicInbox/LeiMark.pm b/lib/PublicInbox/LeiMark.pm index 34846b84..6e611318 100644 --- a/lib/PublicInbox/LeiMark.pm +++ b/lib/PublicInbox/LeiMark.pm @@ -116,11 +116,11 @@ sub lei_mark { # the "lei mark" method my $ops = { '' => [ \&mark_done, $lei ] }; $lei->{auth}->op_merge($ops, $self) if $lei->{auth}; $self->{vmd_mod} = $vmd_mod; - my $op = $lei->workers_start($self, 'lei_mark', 1, $ops); + my ($op_c, undef) = $lei->workers_start($self, 'lei_mark', 1, $ops); $lei->{mark} = $self; $self->wq_io_do('input_stdin', []) if $self->{0}; net_merge_complete($self) unless $lei->{auth}; - while ($op && $op->{sock}) { $op->event_step } + $op_c->op_wait_event($ops); } sub note_missing { -- cgit v1.2.3-24-ge0c7