From 859c834e111b28f0fd68686c826606bdb43e778c Mon Sep 17 00:00:00 2001 From: Sebastien Martini Date: Mon, 22 Dec 2014 17:44:48 +0100 Subject: Implement stop method in AsyncioNotifier --- python2/pyinotify.py | 4 ++++ python3/pyinotify.py | 4 ++++ 2 files changed, 8 insertions(+) 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() -- cgit v1.2.1