diff options
author | Sebastien Martini <seb@dbzteam.org> | 2014-12-22 17:44:48 +0100 |
---|---|---|
committer | Sebastien Martini <seb@dbzteam.org> | 2014-12-22 17:44:48 +0100 |
commit | 859c834e111b28f0fd68686c826606bdb43e778c (patch) | |
tree | 8c34f289e8d32b7897b1c77330da36a2aa73600f | |
parent | 1da0c1c8608e3cc3a735b4db14931762ddaef033 (diff) | |
download | pyinotify-859c834e111b28f0fd68686c826606bdb43e778c.tar.gz |
Implement stop method in AsyncioNotifier
-rwxr-xr-x | python2/pyinotify.py | 4 | ||||
-rwxr-xr-x | python3/pyinotify.py | 4 |
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() |