Skip to content
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

Add ability to send multiple requests at once #23

Merged
merged 35 commits into from Oct 25, 2012
Merged

Add ability to send multiple requests at once #23

merged 35 commits into from Oct 25, 2012

Commits on Jul 3, 2012

  1. Add multiple request support

    This is a first pass and will probably be altered before merging. Still
    needs more hooks and more tests. Only implemented for cURL so far.
    
    Trivia: I wrote this completely without internet access (and hence, no
    documentation either). Imagine my surprise when it worked first time.
    rmccue committed Jul 3, 2012
    Configuration menu
    Copy the full SHA
    99836dd View commit details
    Browse the repository at this point in the history
  2. Only fire multiple.request.complete once parsed

    If we end up with a situation where our hook doesn't fire for some
    reason, we shouldn't pass this on to the hooks. Instead, wait until the
    end when we ensure they're instances.
    rmccue committed Jul 3, 2012
    Configuration menu
    Copy the full SHA
    fb5e1c2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    66235e5 View commit details
    Browse the repository at this point in the history
  4. Add multiple request support to Transport_fsockopen

    fsockopen doesn't support multiple simultaneous requests, so we just
    fake it here instead. What it actually does is to send every request
    sequentially, so the result back from Requests::request_multiple() will
    be the same.
    rmccue committed Jul 3, 2012
    Configuration menu
    Copy the full SHA
    bd4816f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4b0199e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    fe5e7ed View commit details
    Browse the repository at this point in the history
  7. Change cURL hooks around a bit

    curl.before_request and curl.after_request are now fired on every cURL
    request. curl.before_send and curl.after_send are for single requests,
    while curl.before_multi_add, curl.before_multi_exec and
    curl.after_multi_exec are for multiple requests.
    rmccue committed Jul 3, 2012
    Configuration menu
    Copy the full SHA
    ddcff9a View commit details
    Browse the repository at this point in the history
  8. Avoid double-checking for cURL errors

    curl_multi_info_read()'s 'result' value is the same as curl_errno(),
    which we handle per-request in a nicer way.
    rmccue committed Jul 3, 2012
    Configuration menu
    Copy the full SHA
    a2037d6 View commit details
    Browse the repository at this point in the history
  9. Stick to a single shared key for all cURL data

    Rather than relying on typecasting the cURL resource to an integer to
    form a key, use the proper key instead.
    rmccue committed Jul 3, 2012
    Configuration menu
    Copy the full SHA
    80efd61 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    277ee66 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    f39a480 View commit details
    Browse the repository at this point in the history
  12. Pass the ID into the multiple request callback

    To make it easier to track a request after it's complete, we pass in the
    original identifier along with the response.
    rmccue committed Jul 3, 2012
    Configuration menu
    Copy the full SHA
    f925013 View commit details
    Browse the repository at this point in the history
  13. Ensure multi defaults match normal defaults

    This should all be abstracted away.
    rmccue committed Jul 3, 2012
    Configuration menu
    Copy the full SHA
    d4825a0 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    aca20ac View commit details
    Browse the repository at this point in the history
  15. Allow easy hooking into multiple.request.complete

    This is a bit of duplication (given that you can just make your own
    Requests_Hooks and add it), but it saves a few extra lines on the user's
    end.
    rmccue committed Jul 3, 2012
    Configuration menu
    Copy the full SHA
    d7e68b3 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    f8b795d View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    533a4f1 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    cbdd442 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    bacf847 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    2bea203 View commit details
    Browse the repository at this point in the history
  21. Ensure streaming files works properly

    This should fix the currently broken unit tests. Yay!
    rmccue committed Jul 3, 2012
    Configuration menu
    Copy the full SHA
    f81b9f1 View commit details
    Browse the repository at this point in the history
  22. Don't return cURL result by reference

    If we're in non-blocking mode, there's no reference to return. We're not
    really saving anything with this anyway.
    rmccue committed Jul 3, 2012
    Configuration menu
    Copy the full SHA
    df5c648 View commit details
    Browse the repository at this point in the history
  23. Move defaulting code to a common method

    This is currently lacking documentation. Coming soon.
    rmccue committed Jul 3, 2012
    Configuration menu
    Copy the full SHA
    9a4e351 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    b04ac1b View commit details
    Browse the repository at this point in the history
  25. Remove redundant code

    rmccue committed Jul 3, 2012
    Configuration menu
    Copy the full SHA
    ab535ff View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2012

  1. Configuration menu
    Copy the full SHA
    6d14220 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b4b6b67 View commit details
    Browse the repository at this point in the history
  3. Add multirequest tests

    rmccue committed Jul 4, 2012
    Configuration menu
    Copy the full SHA
    a112b3f View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2012

  1. Ensure fsockopen uses the correct hooking system

    multiple.request.complete is called on the request's hooking system, not
    the global one.
    rmccue committed Jul 5, 2012
    Configuration menu
    Copy the full SHA
    3886af0 View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2012

  1. Configuration menu
    Copy the full SHA
    bbcded4 View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2012

  1. Configuration menu
    Copy the full SHA
    570d675 View commit details
    Browse the repository at this point in the history
  2. Test failures in multiple requests too

    Also, move the callback to a proper method. Fixes 5.2 compatibility as well as avoiding duplication.
    rmccue committed Oct 25, 2012
    Configuration menu
    Copy the full SHA
    2b4ce1d View commit details
    Browse the repository at this point in the history
  3. Rewrite the multirequest loop

    Previously, this checked a nonexistent variable, and I'm not sure why. If it
    ever needs to be fixed, blame me.
    rmccue committed Oct 25, 2012
    Configuration menu
    Copy the full SHA
    f8d3aa6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    937c748 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    23c2087 View commit details
    Browse the repository at this point in the history