1 # Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 # used to ensure PublicInbox::DS can call fileno() as a function
5 # on Linux::Inotify2 objects
6 package PublicInbox::In2Tie;
13 if ($in2->can('on_overflow')) {
14 # broadcasts everything on overflow
15 $in2->on_overflow(undef);
18 tie *$io, __PACKAGE__, $in2;
23 my ($class, $in2) = @_;
24 bless \$in2, $class; # a scalar reference to an existing reference
27 # this calls Linux::Inotify2::fileno
28 sub FILENO { ${$_[0]}->fileno }