I need to run groups of dozens of file_get_contents() from other servers (each group would be a server), so I was thinking about doing it in a parallel / non-blocking manner. At least between each group.
Can someone provide a simple code-example (non-working code will be fine), at least just the concept, so I understand how to do this with httprl?
BTW, I need to analyze the contents returned in the body of the requests, and store the status (boolean, depending on certain conditions) for each of the file_get_contents(), but in a single query for each group.
Thank you for reading!
Comments
Comment #1
mikeytown2 commentedCheck the readme for some examples. I can reply in more detail in about a week, on vacation
Comment #2
Fidelix commentedI did check the README, but I guess I did not understand how to make parallel requests and do stuff with the results in a non-blocking way.
Anyway, thanks for answering, Mikey.
Comment #3
mikeytown2 commentedHave you coded something up using file_get_contents yet? If not, can you describe in sudo code what your hoping to do?
From what I've read this is what I'm picturing you currently have.
I'll be basing this example off of the node_load one and the callback one in the readme and the above code I've done this which will do the requests in parallel.
Doing a non blocking request on this is totally dependent on what you plan to do with the results. I really can't help you more until I see what you have coded up. As you can tell the differences are not that big between using file_get_contents and httprl.
Comment #4
mikeytown2 commentedGoing to mark this issue as fixed. I think I answered the question.