]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/InboxIdle.pm
daemon: use ->can to check for IO::Socket::SSL
[public-inbox.git] / lib / PublicInbox / InboxIdle.pm
index c19b8d186cdcdfd88f13d1f38d11c2d835b5d850..d0bb43c58486a5900348a74031cb44f95820bf74 100644 (file)
@@ -58,7 +58,10 @@ sub new {
                my $sock = gensym;
                tie *$sock, 'PublicInbox::In2Tie', $inot;
                $inot->blocking(0);
-               $inot->on_overflow(undef); # broadcasts everything on overflow
+               if ($inot->can('on_overflow')) {
+                        # broadcasts everything on overflow
+                       $inot->on_overflow(undef);
+               }
                $self->SUPER::new($sock, EPOLLIN | EPOLLET);
        } else {
                require PublicInbox::FakeInotify;
@@ -76,4 +79,8 @@ sub event_step {
        warn "$self->{inot}->poll err: $@\n" if $@;
 }
 
+# for graceful shutdown in PublicInbox::Daemon,
+# just ensure the FD gets closed ASAP and subscribers
+sub busy { 0 }
+
 1;