-
Notifications
You must be signed in to change notification settings - Fork 111
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
timeout read_loop? #201
Comments
I haven't tried it, but you might have luck with something like event = asyncio.wait_for(input.async_read_one(), timeout=5) which should raise an exception after the timeout, or select.select([input.fd], [], [], 5)
event = input.read_one() which should be None after the timeout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This project is very helpful in enabling my python program to read input from a barcode reader whilst running as a cron job on reboot.
I would like to timeout the read_loop, after say 5 seconds, rather than wait forever for input which might never come.
Is this do-able?
The text was updated successfully, but these errors were encountered: