use strict;
use warnings;
use base qw(PublicInbox::DS);
-use fields qw(cb arg end end_arg);
+use fields qw(cb arg end_obj);
use Errno qw(EAGAIN);
use PublicInbox::Syscall qw(EPOLLIN EPOLLET);
# $io is a read-only pipe ($rpipe) for now, but may be a
# bidirectional socket in the future.
sub new {
- my ($class, $io, $cb, $arg, $end, $end_arg) = @_;
+ my ($class, $io, $cb, $arg, $end_obj) = @_;
# no $io? call $cb at the top of the next event loop to
# avoid recursion:
unless (defined($io)) {
PublicInbox::DS::requeue($cb ? $cb : $arg);
- die '$end unsupported w/o $io' if $end;
+ die '$end_obj unsupported w/o $io' if $end_obj;
return;
}
$self->SUPER::new($io, EPOLLIN | EPOLLET);
$self->{cb} = $cb; # initial read callback, later replaced by main_cb
$self->{arg} = $arg; # arg for $cb
- $self->{end} = $end; # like END {}, but only for this object
- $self->{end_arg} = $end_arg; # arg for $end
+ $self->{end_obj} = $end_obj; # like END{}, can ->event_step
$self;
}
$self->SUPER::close; # DS::close
# we defer this to the next timer loop since close is deferred
- if (my $end = delete $self->{end}) {
- PublicInbox::DS::requeue($end);
+ if (my $end_obj = delete $self->{end_obj}) {
+ # this calls $end_obj->event_step
+ # (likely PublicInbox::Qspawn::event_step,
+ # NOT PublicInbox::HTTPD::Async::event_step)
+ PublicInbox::DS::requeue($end_obj);
}
}