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

Asynchronous HTTP progress report & Pause/Resume downloads #1340

Open
CaptainPRICE opened this issue May 17, 2019 · 4 comments
Open

Asynchronous HTTP progress report & Pause/Resume downloads #1340

CaptainPRICE opened this issue May 17, 2019 · 4 comments

Comments

@CaptainPRICE
Copy link

CaptainPRICE commented May 17, 2019

I would like to suggest to add a 'progress callback' to HTTP.

  1. Expose a couple of variables via 'progress callback', such as total file size (in bytes), transferred size (downloaded/uploaded size so far, in bytes), transfer rate (download/upload speed, in bytes/sec). And perhaps also approximate time left (in seconds), so that we don't have to do calculation manually.
  2. There's no way of stopping or even pausing/resuming a download/upload. Please consider implementing it.

I just tried to make HTTP downloader/uploader addon, but right now there's nothing more than 'completion callback', alone, is pretty limited functionality. I was aiming for something such as:
image

P.S. I know you may get the total file size by sending a HTTP HEAD request, but the thing is, a file might change between the two separate HTTP requests.

@CornerPin
Copy link

It is not possible to get the file size if server returns chunked data. Also, I think if you pause too much, the server will close the connection because of the time out.

@CaptainPRICE
Copy link
Author

Also, I think if you pause too much, the server will close the connection because of the time out.

Yes. That's why there is "Resume capability" indication (see screenshot).


This makes me think, it would be best to have a class that would represent a HTTP file download/upload request, and a separate class to represent a response.

Please consider: API Draft.

I have spent some time to write that document. Thoughts? :)
P.S. Bear with me. English is not my native language.

@robotboy655
Copy link
Contributor

I can see how some sort of ability to get download progress can be useful, but pausing simply cannot be added, we are using Steamworks HTTP ( https://partner.steamgames.com/doc/api/ISteamHTTP ) stuff and it doesn't have pausing.

@CaptainPRICE
Copy link
Author

@robotboy655 I have updated API draft, please review the changes.
Is it okay? Is there anything else to drop or possibly add?

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

3 participants