-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Async file downloads (sink option) are triggering complete handler too soon #1504
Comments
No? Can you provide more information? What do you see when you look at debug output? Are you using cURL or the stream wrapper? |
How can I enable debug output and where can I find it? Not sure what I'm using but the defaults. Simply instantiating a new Guzzle client and requesting a video, then having it write to a file. To check if it wasn't related to the pool or any other app-specific code, I placed this in the
Result is that it executes the request and triggers |
Are you using threads (like with pthreads)? Guzzle is not thread safe and will not work in a multithreaded application.
|
Yes, pthreads. And it works, but it has the same issue as when I'm not using threads (which was just a test), so doesn't really matter. Request is made, then I think it completes when it receives the headers, and then the file downloads. |
I'm experiencing this same issue. The code to dump the ids is executed, then the script doesn't end until all the downloads finish. I normally fire off a Beanstalk job using those ids, but if the files are still downloading it screws things up. Is there a way to make it wait for the downloads to complete?
|
Bumping this, got the same issue today |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 2 weeks if no further activity occurs. Thank you for your contributions. |
Is it normal that an async request is considered completed almost instantly when using a pool in combination with the sink option to write to a file?
I've tried every bit of code and expect each transfer to finish completely before moving on to the next, especially since I define the number of parallel transfer, but instead it starts downloading the entire queue at once.
The text was updated successfully, but these errors were encountered: