vuongxuongminh/laravel-async

Slow when async::run with multiple functions in db

Opened this issue · 0 comments

      foreach ($requests as $request) {
           Async::run($request);
       }
       [$req1, $req2, $req3, $req4, $req5, $req6] = Async::wait()

Why is using async making my code slower? I'm only running 3 tasks concurrently, but it's taking longer than when I run them synchronously. Am I missing a configuration setting?

Note: These functions are intended to fetch data from multiple tables in the database.