summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Martini <seb@dbzteam.org>2014-12-22 17:44:48 +0100
committerSebastien Martini <seb@dbzteam.org>2014-12-22 17:44:48 +0100
commit859c834e111b28f0fd68686c826606bdb43e778c (patch)
tree8c34f289e8d32b7897b1c77330da36a2aa73600f
parent1da0c1c8608e3cc3a735b4db14931762ddaef033 (diff)
downloadpyinotify-859c834e111b28f0fd68686c826606bdb43e778c.tar.gz
Implement stop method in AsyncioNotifier
-rwxr-xr-xpython2/pyinotify.py4
-rwxr-xr-xpython3/pyinotify.py4
2 files changed, 8 insertions, 0 deletions
diff --git a/python2/pyinotify.py b/python2/pyinotify.py
index dd8f637..5d07654 100755
--- a/python2/pyinotify.py
+++ b/python2/pyinotify.py
@@ -1632,6 +1632,10 @@ class AsyncioNotifier(Notifier):
threshold, timeout)
loop.add_reader(self._fd, self.handle_read)
+ def stop(self):
+ self.loop.remove_reader(self._fd)
+ Notifier.stop(self)
+
def handle_read(self, *args, **kwargs):
self.read_events()
self.process_events()
diff --git a/python3/pyinotify.py b/python3/pyinotify.py
index f4e76e5..576ec52 100755
--- a/python3/pyinotify.py
+++ b/python3/pyinotify.py
@@ -1622,6 +1622,10 @@ class AsyncioNotifier(Notifier):
threshold, timeout)
loop.add_reader(self._fd, self.handle_read)
+ def stop(self):
+ self.loop.remove_reader(self._fd)
+ Notifier.stop(self)
+
def handle_read(self, *args, **kwargs):
self.read_events()
self.process_events()