Small library to convert from CompletableFuture to RxJava2.
- Setup with JitPack
- Use in code:
val future = CompletableFuture.completedFuture(42)
future.asSingle().subscribe{ theAnswer -> searchQuestion(theAnswer) }
RxFutures is build on kotlin extension functions, in order to use it in Java you need to use RxFuturesKt
as follows:
CompletableFuture<Integer> future = CompletableFuture.completedFuture(42);
RxFuturesKt.asSingle(future).subscribe(theAnswer -> searchQuestion(theAnswer));