about summary refs log tree commit homepage
path: root/lib/PublicInbox/KQNotify.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/KQNotify.pm')
-rw-r--r--lib/PublicInbox/KQNotify.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/PublicInbox/KQNotify.pm b/lib/PublicInbox/KQNotify.pm
index 3cf9c0f5..1b5c578e 100644
--- a/lib/PublicInbox/KQNotify.pm
+++ b/lib/PublicInbox/KQNotify.pm
@@ -31,6 +31,7 @@ sub watch {
         } else {
                 die "TODO Not implemented: $mask";
         }
+        bless \$fh, 'PublicInbox::KQNotify::Watch';
 }
 
 # emulate Linux::Inotify::fileno
@@ -57,4 +58,9 @@ sub poll {
         }
 }
 
+package PublicInbox::KQNotify::Watch;
+use strict;
+
+sub cancel { close ${$_[0]} or die "close: $!" }
+
 1;