-sub event_read { $_[0]->{cb}->() }
-sub event_hup { $_[0]->{cb}->() }
-sub event_err { $_[0]->{cb}->() }
-sub sysread { shift->{sock}->sysread(@_) }
+sub async_pass {
+ my ($self, $http, $fh, $bref) = @_;
+ # In case the client HTTP connection ($http) dies, it
+ # will automatically close this ($self) object.
+ $http->{forward} = $self;
+ $fh->write($$bref); # PublicInbox:HTTP::{chunked,identity}_wcb
+ $$bref = undef; # we're done with this
+ my $cb = $self->{cb} = main_cb($http, $fh);
+ $cb->($self); # either hit EAGAIN or ->requeue to keep EPOLLET happy
+}
+
+sub event_step {
+ # {cb} may be undef after ->requeue due to $http->close happening
+ my $cb = $_[0]->{cb} or return;
+ $cb->(@_);
+}