Skip to content

Timeouts implementation #46

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

ilkergzlkkr
Copy link
Contributor

Resolves #38, resolves #43

This might not be the best approach. I think it should be tested a bit more.

if on_timeout:
on_timeout()

if timeout > 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can tell, this only works for timeouts that are explicitly specified by the dev.
There's also the default timeout of the desktop environment/notification daemon that will get applied when timeout == -1 - ideally, the callback should be invoked even in that case. This will likely need platform-specific code though.

Copy link
Owner

@samschott samschott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for not looking at this earlier.

The general approach makes sense to me, but note that platform-supported timeout will still work even if the app / Python is no longer running.

Therefore, I'd prefer to check if the backend supports timeouts and use the manual mechanism only if it doesn't.

This might mean moving any timeout implementation into backends, or querying supported functionality. There is some basic support in the 5.0.0 dev release now for backends to report their capabilities, but this does not (yet) allow for the API layer to add functionality where missing by the backend.

Could you also update the platform support docs and changelog as part of this PR?

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

Successfully merging this pull request may close these issues.

[Feature Request] Support for timeouts
3 participants