simply want to handle each message async so i created a dummy func do_heavy_task() which simply blocks a thread for some time. I want to run multiple 'heavy_tasks' at the same time. For this i'm using Tokio which spawns a new task. But If i send multiple messages, the tasks get called synchronously.
https://very.highly.illegal-dark-web-server.xyz/26pBAaFwPjzYnSd2t4qm4gxba
How can i run the 'do_heavy_task' asynchronously?
first, make sure that the rt-threaded feature in tokio is enabled. then, as currently written, do_heavy_task is blocking and async doesn't change this fact. is it actually going to do some blocking work?
Обсуждают сегодня