X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FInboxIdle.pm;h=ba8200aef05b366220d89e533d9f13c68d48a26f;hb=b2b1006759730507731fcd3fc3e0de68239e3b92;hp=97e9d53250eb43285ae7eba56c3f4ae79d898d8e;hpb=5808636263d72b635a46100a7e7037074dad8f75;p=public-inbox.git diff --git a/lib/PublicInbox/InboxIdle.pm b/lib/PublicInbox/InboxIdle.pm index 97e9d532..ba8200ae 100644 --- a/lib/PublicInbox/InboxIdle.pm +++ b/lib/PublicInbox/InboxIdle.pm @@ -6,7 +6,6 @@ use strict; use base qw(PublicInbox::DS); use fields qw(pi_config inot pathmap); use Cwd qw(abs_path); -use Symbol qw(gensym); use PublicInbox::Syscall qw(EPOLLIN EPOLLET); my $IN_MODIFY = 0x02; # match Linux inotify my $ino_cls; @@ -55,14 +54,8 @@ sub new { my $inot; if ($ino_cls) { $inot = $ino_cls->new or die "E: $ino_cls->new: $!"; - my $sock = gensym; - tie *$sock, 'PublicInbox::In2Tie', $inot; - $inot->blocking(0); - if ($inot->can('on_overflow')) { - # broadcasts everything on overflow - $inot->on_overflow(undef); - } - $self->SUPER::new($sock, EPOLLIN | EPOLLET); + my $io = PublicInbox::In2Tie::io($inot); + $self->SUPER::new($io, EPOLLIN | EPOLLET); } else { require PublicInbox::FakeInotify; $inot = PublicInbox::FakeInotify->new;