+# this is the write-only end of a pipe, DS->EventLoop will call this
+sub event_step {
+ my ($self) = @_;
+ $self->flush_write;
+ $self->close if !$self->{in}; # process died
+}
+
+no warnings 'once';
+
+sub DESTROY {
+ my ($self) = @_;
+ delete $self->{in};
+ # GitAsyncCat::event_step may reap us with WNOHANG, too
+ my $pid = delete $self->{pid} or return;
+ if ($$ == $self->{owner_pid}) {
+ PublicInbox::DS->in_loop ? $self->close : delete($self->{sock});
+ dwaitpid $pid;
+ }
+}
+
+# used by GitAsyncCat
+*cat_async_step = \&PublicInbox::Git::cat_async_step;
+