cescoffier / vertx-completable-future

An implementation of CompletableFuture for Vert.x
Apache License 2.0
79 stars 29 forks source link

Incompatible with ServiceProxy:Proxy methods must have void or Fluent returns #43

Open AndierZ opened 4 years ago

AndierZ commented 4 years ago

First of all I really appreciate the work that people did here. I really liked the concept of completable future and was going to replace all my AsyncResult callbacks with VertxCompletableFuture, but then I realized that the code gen for proxy service won't work because of the error in the title. I realized that this is not a problem of VertxCompletableFuture per se, but figured this might be a relevant place to ask..

It was a real bummer because if it worked it would make things so much cleaner.. I was able to shorten my code by like 40%..

Any suggestion as to work arounds? Any hope that Vertx Core will modify the code gen to allow this?

Regards, Andier

AndierZ commented 4 years ago

Spend some more time looking for alternatives. Looks like the most promising way is to do what Vertx team did with the rxJava - build a codegen to create a wrapper which uses the actual service as a delegate and then returns a VertxCompletableFuture? Does that sound reasonable? I could give that a shot.

For some reason I still prefer CompletableFuture over rxJava.. its api feels slightly neater..

cescoffier commented 4 years ago

Unfortunately, the only solution would be to implement the code-generation tool from the service proxies to use CompletionFuture.