Change progress reporter functional interface to an interface #72
Closed
lordofthejars
started this conversation in
General
Replies: 2 comments 1 reply
-
Go for it! |
Beta Was this translation helpful? Give feedback.
1 reply
-
#80 was merged (thanks!) closing out this discussion |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, the progress reporter uses a functional interface, which receives a String, Long, Long. But since it is a functional interface, they are generic, so I have no clue of what each parameter is. Yes, I know String is the filename, but what about the following two longs, what is the current downloaded bytes and what is the total bytes size? I can think of first the current downloaded and the second one the total, or why not in the other way. So at the end you inspect the source code of HttpSupport class to check.
I think it would be better to create an interface like:
Then a developer can understand exactly what to expect.
I know this could lead to breaking the API now as some users might use the functional interface. For this reason, I have created a discussion.
If you think it is a good idea, then I can provide a PR, if you think it is too risky (which I can understand) then I can provide a PR adding javadoc explaining each of the parameters in the download method.
Beta Was this translation helpful? Give feedback.
All reactions