lagom / lagom

Reactive Microservices for the JVM
https://www.lagomframework.com
Apache License 2.0
2.63k stars 634 forks source link

CompletionStageUtils #732

Open edouardKaiser opened 7 years ago

edouardKaiser commented 7 years ago

In the online-auction example, there is a CompletionStageUtils which contains very useful helpers to manipulates CompletionStage. it might be worth moving this to Lagom itself.

Anyone manipulating CompletionStage ends up writing this exact set of functions.

jroper commented 7 years ago

Tell me about it. And trust me, we did do our best to try and influence the CompletionStage API to include these before JDK 8 came out, that would have been the best solution, but unfortunately nothing came of it.

I don't know if these belong in Lagom or not - I'd rather not be responsible for maintaining utility APIs like this, once you add one utility method, then why not add a whole suite of methods? There are dedicated libraries for making up for the short comings of the JDK, such as Guava and commons-lang, it'd be better to add these there and then make everyone depend on one of those.

edouardKaiser commented 7 years ago

I understand your point of view, in another project we wrapped the CompletionStage into something more meaningful and useful in terms of API design.

Ultimately it should sit somewhere else, you're right, but you guys are moving faster than any of the big mastodon (Guava, Apache Lang...).

No big deal, I was just curious if you guys thought about it.