1 # Copyright (C) 2016-2019 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;
9 use base qw(PublicInbox::DS);
11 use PublicInbox::Syscall qw(EPOLLIN EPOLLONESHOT);
14 my ($class, $pipe, $worker_quit) = @_;
15 my $self = fields::new($class);
16 $self->SUPER::new($pipe, EPOLLIN|EPOLLONESHOT);
17 $self->{cb} = $worker_quit;
21 # master process died, time to call worker_quit ourselves
23 $_[0]->close; # PublicInbox::DS::close