It would be nice to support a niladic form of Call#enqueue that returns CompletableFuture<Response>. Is it currently reasonable to upgrade support for Android to at least v7.0 (API Level 24, where CompletableFuture arrives)?
That accounts for 0.7% of active Android devices so it will be at least 3
or 4 years before Java 8 is viable for a project like OkHttp.
On Wed, Jan 11, 2017 at 2:09 PM John Napier notifications@github.com
wrote:
It would be nice to support a niladic form of Call#enqueue that returns
CompletableFuture. Is it currently reasonable to upgrade support for
Android to at least v7.0 (API Level 24, where CompletableFuture arrives)?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/square/okhttp/issues/3102, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEEEWtmgS1Ve4qctF7fOMdaifj87k0Uks5rRVL9gaJpZM4LhIWm
.
We could ship a sibling module adding static methods to wrap a Call, but it
seems fairly low-value since it's fairly easy to write your own. Also
Kotlin extension methods work great here since you can add an enqueue-like
method that returns a CompletableFuture.
On Wed, Jan 11, 2017 at 2:23 PM John Napier notifications@github.com
wrote:
Closed #3102 https://github.com/square/okhttp/issues/3102.
—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
https://github.com/square/okhttp/issues/3102#event-919888538, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAEEEazMUvz6TOnE_xS87E1MSE1qJwG5ks5rRVZ3gaJpZM4LhIWm
.
I see that Java 8 is required now - will be great to reopen this issue.
Worth a quick discussion. Seems high value for java callers.
CF is a pretty poor API to push people towards though. I wouldn't want to evangelize its use implicitly.
I agree with you @JakeWharton but do we really need something more in simple applications (lambda functions in my case)?
For me CF is better than custom Callback class - I can integrate it with my software in an easier way then.
I think you can write about 6 lines of code to do this. Maybe paste a sample here for those interested? I don't want this in the library directly.
@swankjesse could you elaborate a bit? Custom Callback class vs standard JVM solution (CF)?
Btw. I know how to do that in a few lines - to be honest, I've considered contribution ;) because this is simply stupid and probably many people waste time to do that in their projects?
Please keep in mind that I'm not ❤️ in CF - I just don't like to reinvent the wheel.
Most helpful comment
CF is a pretty poor API to push people towards though. I wouldn't want to evangelize its use implicitly.