-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it easy to find out "which response is which" #14
Comments
Hey @stil , Can you share a specific use case? I guess today you could simple build this in your application logic?! |
An use case could be for example fetching list of paginated offers from online shopping website. You would make 10 requests to download first 10 pages of offers.
Then you send requests in parallel. Responses may appear in different order, and you wouldn't know which page you have just fetched. Currently there are two ways to associate responses:
$i = 1;
$request = new \cURL\Request("http://www.morele.net/komputery/sieci/routery-48/0,0,,,,,,,,,/$i/");
$request->_page = $i;
First approach is unelegant and some IDEs will complain about setting dynamic attributes. And second requires a few additional lines of code. Or, in more object oriented way: |
Ok I see. Thanks for the detailed response. Your third solution seems most appropriate. Especially with interface implementation, because it allows freedom to the user to implement whatever he wants it for. Not sure about the setContext naming though. That being said I don't have any alternatives to share. |
awesome! can't wait |
worked for me, in the
thanks stil |
It's a very popular problem - how to know which response is which. They may appear in random order, so we need to add a feature allowing to associate responses with their starting parameters.
The text was updated successfully, but these errors were encountered: