From b2b1006759730507731fcd3fc3e0de68239e3b92 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 27 Jun 2020 10:03:36 +0000 Subject: watch: remove Filesys::Notify::Simple dependency Since we already use inotify and EVFILT_VNODE (kqueue) in -imapd, we might as well use them directly in -watch, too. This will allow public-inbox-watch to use PublicInbox::DS for timers to watch newsgroups/mailboxes and have saner signal handling in future commits. --- lib/PublicInbox/In2Tie.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/PublicInbox/In2Tie.pm') diff --git a/lib/PublicInbox/In2Tie.pm b/lib/PublicInbox/In2Tie.pm index db1dc104..7dee3627 100644 --- a/lib/PublicInbox/In2Tie.pm +++ b/lib/PublicInbox/In2Tie.pm @@ -5,6 +5,19 @@ # on Linux::Inotify2 objects package PublicInbox::In2Tie; use strict; +use Symbol qw(gensym); + +sub io { + my $in2 = $_[0]; + $in2->blocking(0); + if ($in2->can('on_overflow')) { + # broadcasts everything on overflow + $in2->on_overflow(undef); + } + my $io = gensym; + tie *$io, __PACKAGE__, $in2; + $io; +} sub TIEHANDLE { my ($class, $in2) = @_; -- cgit v1.2.3-24-ge0c7