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

client: add a timeout parameter on most Api methods #238

Open
greenknot opened this issue Jul 30, 2021 · 0 comments
Open

client: add a timeout parameter on most Api methods #238

greenknot opened this issue Jul 30, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@greenknot
Copy link
Contributor

Api.get_next_event() and Api.wait_for_text_event() can be stuck forever in case of unexpected behaviors from the device. There should be atimeout parameter to prevent that. I tried hard to implement a timeout feature on requests.Response.raw.readline() with:

  • threading.Timer which close the socket after the specified amount of time has passed, but it doesn't make requests.Response.raw.readline() fail
  • select.poll on the request socket and it doesn't work either

(As a side node, I think HTTP requests should also timeout after some time, but it can be done easily with requests.)

@greenknot greenknot added the enhancement New feature or request label Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant