Convert vert.x Future to rxJava

311 views
Skip to first unread message

Himanshu Gupta

unread,
Dec 8, 2021, 2:50:28 AM12/8/21
to vert.x
Hi,

How do I convert vert.x Future<T> to rxjava Single or Maybe ?

Thanks,
Himanshu

Julien Viet

unread,
Dec 8, 2021, 3:42:18 AM12/8/21
to vert.x
Hi,

you can use https://vertx.io/docs/apidocs/io/vertx/reactivex/SingleHelper.html#toSingle-java.util.function.Consumer-

Single<T> s = SingleHelper.toSingle(future::onComplete);

Julien
> --
> You received this message because you are subscribed to the Google Groups "vert.x" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/303db1c4-59fe-4022-aa0c-b7ea0a050072n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages