Add something like "JS Promise" to STD for JDK 6/Android users


#1

Async/Await is very cool, but on Android we can’t use CompletableFuture.
Can you add some VERY-LIGHT-BASE (2-3 classes) support for Promises as alternative to CompletableFuture?

We only need some basic-core implementations.
For this core we (android devs) can write some extensions by ourselves.

OR maybe i don’t know better solution (NOT RxJava)?

P.S.
I propose “promise” to avoid conflicts with namespaces of standard libraries.


#2

Look streamsupport-cfuture


#3

Thanks! I already checked this library.
It’s main flaw that author don’t create separate module only with “CompletableFuture” (without dependencies).

Now his module for completable future
https://mvnrepository.com/artifact/net.sourceforge.streamsupport/streamsupport-cfuture/1.5
depend to core library with "ALL stream classes"
https://mvnrepository.com/artifact/net.sourceforge.streamsupport/streamsupport
this is 1 MB of class thats i don’t need, because i use standard Java List/Array + Kotlin extensions


#4

In my opinion you should open an issue on github.


#5

You might be interested in my promises library http://kovenant.komponents.nl/android/features/