Starting with Vert.x 4.5.0, Vertx#rxExecuteBlocking (and the signatures of executeBlocking that return a Maybe) are deprecated.
How should I go from a Vert.x Future (with Vertx#executeBlocking) to an RxJava Maybe (or an Observable)?
Starting with Vert.x 4.5.0, Vertx#rxExecuteBlocking (and the signatures of executeBlocking that return a Maybe) are deprecated.
How should I go from a Vert.x Future (with Vertx#executeBlocking) to an RxJava Maybe (or an Observable)?
This isn't the answer I'm looking for, but is an answer nonetheless
I imagine that there must somewhere be a function that turns a
Futureto aMaybeor even anObservablestraight away. That's what I'm looking for!The option I figured out
Here's an option, although I'm not sure it is the most appropriate one:
Where you would get a Vert.x
Futurefrom some computation-intensive activity (such asThread#sleep) from a method defined as follows:You could get a
Maybelike so:As an additional note, I'd like to point out that the
Maybe-to-Observableconversion seems to be trivially resolved usingMaybe#toObservable, thus allowing the following way to obtain anObservableout ofVertx#executeBlocking:Here's a small helper class that may assist you in converting a Vert.x
Futureto an RxJavaObservable(which I think should exist in thevertx-rx-java3package but I can't locate):