1 # Copyright (C) 2016-2020 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 # only for PublicInbox::Daemon, allows worker processes to be
5 # notified if the master process dies.
6 package PublicInbox::ParentPipe;
8 use parent qw(PublicInbox::DS);
9 use PublicInbox::Syscall qw(EPOLLIN EPOLLONESHOT);
12 my ($class, $pipe, $worker_quit) = @_;
13 my $self = bless { cb => $worker_quit }, $class;
14 $self->SUPER::new($pipe, EPOLLIN|EPOLLONESHOT);
17 # master process died, time to call worker_quit ourselves
19 $_[0]->close; # PublicInbox::DS::close