0

I want to do parallel processing in laravel as shown in this image. I have a function1 in which it calls 2 functions: function2 and Function3 , both of them takes image as the argument and does some processing and then I have a function C, which takes results of both of them and process it(both the results) and return final output. I want to run function2 and function3 in parallel and wait for their result in funtion4.

More info: Function2: is an API call to google vision ocr Function3: is a image processing scrpit written in python using OpenCV. Function4: Basically cleans the result of google vision ocr using output of function3

I want to ask how can I do it? I have research about it and found out parallel: https://www.php.net/manual/en/book.parallel.php#book.parallel

Will using this library will do the job? If yes, what are disadvantages of it?

  • Please provide enough code so others can better understand or reproduce the problem. – Community Jul 27 '22 at 04:09
  • PHP doesn’t support multiple threads, so you can’t do parallel requests. You’ll need to use something like JavaScript where you can make multiple AJAX requests in parallel, You can look into this https://stackoverflow.com/questions/36830979/multi-threading-in-laravel – Aqib Javed Jul 27 '22 at 04:55

0 Answers0