-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Please create PROGRESS method #656
Comments
Can you please detail what you expect? |
Example: Document doc = Jsoup.connect("http://example.com") |
This comment was marked as duplicate.
This comment was marked as duplicate.
int progress = 0(%) - 100(%) downloaded The code in the example is invalid Java code. Can you adress this? What happen if the total size is unknown? |
This comment was marked as duplicate.
This comment was marked as duplicate.
Yes I know what you mean, like in the Android Progress methods. Good idea, |
It I think this could be implemented by just returning the position of the byte stream every time an element is hit |
OK it took me a little while to get to this. But still, less then a decade! Coming with #2164. The signature looks like: @FunctionalInterface
public interface Progress<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.
*/
void onProgress(int processed, int total, float percent, ProgressContext context);
} 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 Fixes #656
Thank you! |
Hi,
Can you implement a method of progress?
It is necessary to indicate the progress of the html page downloaded.
Thanks
The text was updated successfully, but these errors were encountered: