Does Tokio have a limit on the number of tasks #3649
-
The code is:
when I add TOPIC4 to topics, the task in loop not run at all。If i add TOPIC4 and remove another topic. It will work fine, I dont know why is it or is there something wrong with my usage. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
No, there is no maximum number of tasks. If some of your tasks are not running, you should investigate if some of the other tasks are blocking the thread, as this can prevent tasks from running. One thing I notice is that the |
Beta Was this translation helpful? Give feedback.
No, there is no maximum number of tasks. If some of your tasks are not running, you should investigate if some of the other tasks are blocking the thread, as this can prevent tasks from running.
One thing I notice is that the
continue
in your else branch would lead to an infinite loop. You only hit the else branch when the channel is closed, so you should break from the loop in that case.