async-http-client icon indicating copy to clipboard operation
async-http-client copied to clipboard

Tracking Send/Upload Progress

Open mredig opened this issue 9 months ago • 7 comments

Am I correct that to track the progress of sent data, you need to use a delegate? And further, I would need to use futures to use the delegate? I can't seem to figure out how to do either of those things (tracking send progress being the goal) without using event futures.

If I am correct, let's file this under a feature request to allow for delegate/ability otherwise to track send progress.

mredig avatar Mar 02 '25 04:03 mredig

That's correct, yes. Can you suggest an outline of an API shape you'd like to use for tracking sent data?

Lukasa avatar Mar 03 '25 08:03 Lukasa

Well the delegate would be satisfactory for me. I am not against passing a delegate into an individual network call, either, just like the futures interface offers.

This is just my initial thought, tho. I'll give it a bit deeper thought and try to get back soon!

mredig avatar Mar 03 '25 08:03 mredig

Is this delegate method sufficient for the use-case?

Lukasa avatar Mar 03 '25 08:03 Lukasa

Sufficient, yes! I feel dirty using IOData though, since it's marked for deprecation :P

This method is actually how I'm currently achieving what I need, albeit through the futures interface.

mredig avatar Mar 03 '25 08:03 mredig

Oh dang, ok, so that we can deal with. Would you be open to producing a patch that adds a variant of that method that just accepts ByteBuffer? I think the patch would require deprecating & defaulting the IOData-taking one, as that method is obviously not safe for us to actually use. We can then default the new ByteBuffer-taking one to call the old IOData-taking one.

Lukasa avatar Mar 03 '25 08:03 Lukasa

I would love to! Any deadlines to try to meet?

mredig avatar Mar 03 '25 08:03 mredig

Nope, do this on your own time.

Lukasa avatar Mar 03 '25 10:03 Lukasa