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

Calling startRequest() from within callback - infinite loop #6

Open
joehoyle opened this issue Sep 6, 2012 · 2 comments
Open

Calling startRequest() from within callback - infinite loop #6

joehoyle opened this issue Sep 6, 2012 · 2 comments

Comments

@joehoyle
Copy link

joehoyle commented Sep 6, 2012

Hey, great library!

Hoever, I found if you call addRequest from with a callback you get a infinite loop, as the outstanding_requests is not removed until the callback function has returned. If you were to switched this around, so the outstanding_requests is unset beforehand, it would allow addRequest then finishAllRequests to be called within the callback function.

I have modified this locally, I can send it as a p/r if you wish.

Thanks

@petewarden
Copy link
Owner

Thanks Joe! I appreciate it, and a pull request would be handy, and I'll check it over when I have a chance. One pattern I've used in the past is creating a new ParallelCurl object from within the request callback, but I can see why your case is useful.

@joehoyle
Copy link
Author

@petewarden yeah I had considered that, though I am using a layer of abstraction in for the form of a HTTP_Requester class, which does some other boilerplate stuff, so access the same ParallelCurl request was more simple in that case. I'll open a p/r

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants