-
-
Notifications
You must be signed in to change notification settings - Fork 495
New abortDownload function for downloadFile (#4157)
#4438
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
Conversation
...ter resource management
I think new feature PRs are on-hold for now. 1.7 release is waiting for fixes first
Either way, this is cool
Thank you for adding this feature, much needed.
If it isnt too much work, could you also add something like:
local numBytesDownloaded, numTotalBytesToDownload = getDownloadProgress(downloadHandler);
Very good addition for UIs to display the download progress.
The main problem is that practical usage is limited due to a fundamental issue with downloadFile.
Currently, downloadFile is blocking (synchronous), it halts script execution until the file is fully downloaded.
This prevents proper asynchronous handling and makes progress tracking ineffective during the actual download.
How feasible would it be to create something like asyncDownloadFile function?
How feasible would it be to create something like asyncDownloadFile function?
Why not just make downloadFile not blocking? I think that wouldn't break scripts. It returns true if file to download was queued successfully - is this the slow operation?
How feasible would it be to create something like asyncDownloadFile function?
Why not just make downloadFile not blocking? I think that wouldn't break scripts. It returns true if file to download was queued successfully - is this the slow operation?
Yes I see no problem making downloadFile async in general. No one sane would put lua logic after downloadFile call.
Uh oh!
There was an error while loading. Please reload this page.
Warning
(削除) This feature has not been fully tested. Please test thoroughly and report any issues or unexpected behaviors. Your feedback is highly appreciated (削除ここまで).New Functionality
abortDownload(handlerId)Cancels an ongoing download using a unique handler ID.
The function returns
falsein these cases:truewhen the download was successfully cancelled.Usage Example
🛠️ Changes
downloadFileandabortDownload.Breaking Changes
downloadFile()now returns two values (download object,handler ID) instead of a single boolean.🔗 Resolves