You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code in the example is invalid Java code. Can you adress this?
I know. Just gave the example of the approximate realization to obtain information about how to download the object.
What happen if the total size is unknown?
At the beginning of the boot progress = 0. At the end of progress = 100. The intermediate result is unknown.
@FunctionalInterfacepublicinterfaceProgress<ProgressContext> {
/** Called to report progress. Note that this will be executed by the same thread that is doing the work, so either don't take to long, or hand it off to another thread. @param processed the number of bytes processed so far. @param total the total number of expected bytes, or -1 if unknown. @param percent the percentage of completion, 0.0..100.0. If the expected total is unknown, % will remain at zero until complete. @param context the object that progress was made on. */voidonProgress(intprocessed, inttotal, floatpercent, ProgressContextcontext);
}
So that we can pass a Response in for the context, so you can get the URL, headers etc. And we can also add other progress events, like during parsing, uploads, etc.
Thank you!
I am very surprised that you have not forgotten about my request, because you have already forgotten about it.
Yes, this question is also relevant to me.
Thank you for your hard work!
Activity
Stephan972 commentedon Aug 22, 2016
Can you please detail what you expect?
crysan commentedon Aug 23, 2016
Example:
Document doc = Jsoup.connect("http://example.com")
.userAgent("Mozilla")
.timeout(3000)
.onProgress (long totalBytes, long downlaodedBytes, int progress){
tada();
}
.post();
Stephan972 commentedon Aug 23, 2016
crysan commentedon Aug 23, 2016
int progress = 0(%) - 100(%) downloaded
The code in the example is invalid Java code. Can you adress this?
I know. Just gave the example of the approximate realization to obtain information about how to download the object.
What happen if the total size is unknown?
At the beginning of the boot progress = 0. At the end of progress = 100. The intermediate result is unknown.
Stephan972 commentedon Aug 23, 2016
jhy commentedon Aug 23, 2016
Yes I know what you mean, like in the Android Progress methods. Good idea,
thanks!
InputNeuron commentedon Feb 8, 2017
It I think this could be implemented by just returning the position of the byte stream every time an element is hit
jhy commentedon Jul 5, 2024
OK it took me a little while to get to this. But still, less then a decade!
Coming with #2164.
The signature looks like:
So that we can pass a Response in for the context, so you can get the URL, headers etc. And we can also add other progress events, like during parsing, uploads, etc.
Added a Response progress event interface (#2164)
crysan commentedon Jul 8, 2024
Thank you!
I am very surprised that you have not forgotten about my request, because you have already forgotten about it.
Yes, this question is also relevant to me.
Thank you for your hard work!
chore(deps): update all non-major dependencies (mulk/mulkcms2!55)