Replies: 2 comments 11 replies
-
There is no practical limit for creating asyncio tasks. The limit seems to be the available RAM, since each task needs a bit of RAM. I don't know the real limit, but I have run 100 concurrent asyncio tasks on a ESP32 with no problems at all. What problems are you experiencing? Can you show the code that fails? |
Beta Was this translation helpful? Give feedback.
-
@rarefeen: There is more than one way to do it. As far as I understand the
a) You could steal(maybe inherit) the general concept of b) Nothing stops you from creating another task from inside the callback and cancel the "connected" tasks. Asyncio tasks are cheap. async def callback(...)
data_handler = asyncio.create_task(...) # runs in the background, but not longer than 0.5s
await asyncio.sleep_ms(500)
asyncio.cancel(data_handler)
await data_handler |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I've been trying to communicate between esp32's using tcp socket using uasyncio in micropython. but so far I've failed when I do more jobs with the uasyncio tasks.
is it limited to the firmware that I cannot do it for a reason?
or is there any other way?
[i am using uasyncio to get data from sensors too]
Beta Was this translation helpful? Give feedback.
All reactions