Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does the watchdog have a method for detecting function timeout? #1004

Open
b-niu opened this issue Aug 29, 2023 · 0 comments
Open

Does the watchdog have a method for detecting function timeout? #1004

b-niu opened this issue Aug 29, 2023 · 0 comments

Comments

@b-niu
Copy link

b-niu commented Aug 29, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant