Timeout on asyncio.core._io_queue.queue_read(stream) #10894
Unanswered
edurohr
asked this question in
Using MicroPython
Replies: 2 comments 1 reply
-
You need to use |
Beta Was this translation helpful? Give feedback.
1 reply
-
I have no experience of using USB VCP with The normal way to handle stream input is with a StreamReader object. This uses a more efficient way to wait on I/O compared with the above busy-wait loop. The doc referenced explains how this works internally using I'm puzzled by yield asyncio.wait_for_ms(wait_for_data(), timeout=1_000) The normal way is await asyncio.wait_for_ms(wait_for_data(), timeout=1_000) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have a function that waits asynchronously for some data to be available for reading in a stream.
I would like to be able to timeout if I don't receive the expected amount of data within a certain time.
How can this be achieved with micropython?
Original code:
Desired behaviour (with code that doesn't work):
Beta Was this translation helpful? Give feedback.
All reactions