Closed jlledom closed 4 months ago
@akostadinov @mayorova I made some changes from your comments in the call:
Sync
call which creates a new reactor, so it's clear which is the root reactor and where it's defined.Async
from the processor. This way they run sequentally because they are all in the same task under the parent reactor. All tasks under process_all
and clear_queue
are added to the same parent reactor, so the main task could get executed between tasks. This is prevented by the barrier, which makes the main task to wait until all children tasks finish.@akostadinov I implemented your suggestions
The asynchronous worker was using a custom method to control the amount of concurrent tasks in the reactor. However, Async provides some tools for this. Better use them rather than inventing the wheel.
Check: https://socketry.github.io/async/guides/best-practices/index
This also includes some minor changes to:
How to verify:
CONFIG_ASYNC_WORKER_MAX_CONCURRENT_JOBS
to the desired number.puts semaphore.count
thatCONFIG_ASYNC_WORKER_MAX_CONCURRENT_JOBS
is never exceeded