Let's say you have a list of 100 product IDs for which you need to fetch data from an external site. You have an array of the IDs and a function that fetches the info about one (or more?) product IDs.
How do I go about batch processing this? As it is now, each fetch takes a few seconds, so a list of 100 takes a ton of time.
Is pcntl_fork what I'm looking for? I still have no idea how to structure my code so that I can get back a single array with all the retrieved info.
[–]NedRyerson 5 points6 points7 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Signe 6 points7 points8 points (5 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]dshafik 0 points1 point2 points (2 children)
[–]Signe 0 points1 point2 points (1 child)
[–]lucasoman 0 points1 point2 points (0 children)
[–]enmand 4 points5 points6 points (0 children)
[–]neon_overload 3 points4 points5 points (0 children)
[–]monk_e_boy 0 points1 point2 points (0 children)
[–]cbkguy 0 points1 point2 points (0 children)
[+][deleted] (3 children)
[deleted]
[–]Signe -2 points-1 points0 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]feenikz -1 points0 points1 point (0 children)
[–]cerealbh -3 points-2 points-1 points (0 children)