Usage of asyncio.wait_for #9511
-
I have two esp 32 boards running micropython. On Board A an interrupt occurs I have an asyncio task in Board A waiting for responses from B which adds them to a Queue It sets a responseEvent - asnycio event I want to wait on the event but since the event may not even occur, I have to time out, Hence I tried
the above doesn't wait at all, can you please correct the syntax or my misinterpretation that this is how this is done! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
This is an odd use of |
Beta Was this translation helpful? Give feedback.
This is an odd use of
asyncio.run
. The best way to interface between interrupts anduasyncio
is to use ThreadSafeFlag; see also this ref. You might also want to read these notes on the use of timeouts - it looks like you're missing anawait
.