Does the watchdog have a method for detecting function timeout?
b-niu opened this issue · comments
Dear contributors,
Can I use some method to achieve this function:
from watchdog.events import FileSystemEventHandler
from watchdog.observers import Observer
class MyEventHandler(FileSystemEventHandler):
def __init__(self):
FileSystemEventHandler.__init__(self)
...
def on_modified(self, event):
set_a_timeout_of_3_seconds()
do_something()
if the_function_ends_in_3_seconds:
pass
else:
break_it()
I have tried the eventlet
and signal
module, but all of them cannot be used with watchdog together.
Thanks a lot!