-
Notifications
You must be signed in to change notification settings - Fork 16
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 http_download function to simplify downloading files #433
Conversation
2d329e3
to
bd2261d
Compare
Why not use The only point that can be not good idea is if the user override the WDYT about add a progress bar as progress indicator for no verbose case ? This might be useful on large files or for those want to show progress anyway |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't review the download implementation yet, but it's a good start
I initially dismissed this idea for the reason you highlighted. However, upon reflection, I could wrap the user's on_progress callback with our implementation.
I considered this too but opted to avoid cluttering the standard output by default since, as far as I know, few native Castor functions currently output anything. I aimed to maintain consistency by making the progress display an "opt-in" mechanism, leveraging the existing verbose feature for this purpose. I'm open to either approach. Let's hear what others have to suggest. |
yes, let's be silent by default 👍🏼 |
bd2261d
to
dc63ed5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
except nitpicking, it looks good 👍🏼
a8b6621
to
046b382
Compare
Hi, for the record, I have finished this PR. I fixed all my comments, and I also rebased. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small question in the doc, but looks go to me otherwise. Thanks to both of you :)
The `stream` parameter controls whether the download is chunked (`true`), which | ||
is useful for large files as it uses less memory, or in one go (`false`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we mention the default value?
@lyrixx Ah, now I understand! You wanted me to keep the Thank you for completing the work! 👍 I hope it will be useful for others. |
yes, Single Responsibility for the win 👍🏼 |
Continuation of #293
It narrows the scope to a simple
http_download()
function for now. Separateshttp_upload()
into its own future PR due to its unique complexities and diverse HTTP upload methods.Feature details are in the documentation.