http icon indicating copy to clipboard operation
http copied to clipboard

added onUploadProgress

Open Mehmetyaz opened this issue 2 years ago • 6 comments

added onUploadProgress to MultipartRequest.new and Client.send. (adjusted file movements)

Mehmetyaz avatar Jul 01 '22 22:07 Mehmetyaz

@kevmoo - More than 80 changes appeared in the previous frok. With the new fork, your inspection will be easier.

Mehmetyaz avatar Jul 01 '22 22:07 Mehmetyaz

@natebosch , could you take a look at this?

brianquinlan avatar Jul 19 '22 00:07 brianquinlan

FYI, @natebosch is on holiday until late next week so don't expect feedback until then.

brianquinlan avatar Jul 22 '22 17:07 brianquinlan

Is there anything needed here before this is merged? I'd really love to see this merged and support added to cupertino_http.

mehcode avatar Sep 14 '22 04:09 mehcode

@brianquinlan @lrhn ?

kevmoo avatar Sep 14 '22 21:09 kevmoo

I'd still like to understand how meaningful these numbers are. Moving the http implementation to the progress event helps - it feels like we're adding specific value in that case. If we feel like the stream watching is high enough fidelity for the IO case we can support both through the same interface. Are we confident in that fidelity @brianquinlan @lrhn ? Is there any buffering in between this Stream that we can account for better with an API in the SDK? Will watching the Stream consumption be meaningful for the cronet and cupertino implementations?

If what we're offering is implemented as a callback that gets invoked as the Stream is consumed - does that need to be shipped as part of package:http?

natebosch avatar Sep 15 '22 00:09 natebosch

I patched this change locally and did some testing.

For IOClient, the progress seemed useful for large requests (assuming that the stream is split into relatively small lists). On my Mac, ~500KiB of progress would be indicated before the first byte arrives on the server. So presumably that is approximately when the TCP write buffer is full [1].

For BrowserClient, I was not able go get any progress messages when running on Chrome - @Mehmetyaz how did you test this?

[1] I think that this can be verified by checking availableSendBuffer

brianquinlan avatar Jul 11 '23 17:07 brianquinlan

Moved to #1071

Mehmetyaz avatar Dec 05 '23 22:12 Mehmetyaz