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?