# but only after all pending writes are done.
# autovivify wbuf. wbuf may be populated by $cb,
# no need to rearm if so: (push returns new size of array)
- requeue($self) if push(@{$self->{wbuf}}, \&long_step) == 1;
+ $self->requeue if push(@{$self->{wbuf}}, \&long_step) == 1;
}
sub long_response ($$;@) {
$self->msg_more(")\r\n");
}
+sub requeue { # overrides PublicInbox::DS::requeue
+ my ($self) = @_;
+ if ($self->{anon}) { # AUTH=ANONYMOUS gets high priority
+ $self->SUPER::requeue;
+ } else { # low priority
+ push(@{$self->{imapd}->{-authed_q}}, $self) == 1 and
+ PublicInbox::DS::requeue($self->{imapd});
+ }
+}
+
sub fetch_blob_cb { # called by git->cat_async via ibx_async_cat
my ($bref, $oid, $type, $size, $fetch_arg) = @_;
my ($self, undef, $msgs, $range_info, $ops, $partial) = @$fetch_arg;
$_[0]->{idler} //= PublicInbox::InboxIdle->new($_[0]->{pi_cfg});
}
+sub event_step { # called vai requeue for low-priority IMAP clients
+ my ($self) = @_;
+ my $imap = shift(@{$self->{-authed_q}}) // return;
+ PublicInbox::DS::requeue($self) if scalar(@{$self->{-authed_q}});
+ $imap->event_step; # PublicInbox::IMAP::event_step
+}
+
1;