-
-
Notifications
You must be signed in to change notification settings - Fork 491
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
base: master
Are you sure you want to change the base?
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. 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 |
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. |
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
false
in these cases:true
when the download was successfully cancelled.Usage Example
🛠️ Changes
downloadFile
andabortDownload
.Breaking Changes
downloadFile()
now returns two values (download object
,handler ID
) instead of a single boolean.🔗 Resolves