fzakaria / WaterFlow

WaterFlow is a non-magical / easy to understand / JDK8 framework for use with SWF
http://fzakaria.github.io/WaterFlow/
MIT License
20 stars 2 forks source link

Move from CompletionStage to 'ComposablePromise' #1

Open fzakaria opened 8 years ago

fzakaria commented 8 years ago

CompletionStage has a few hairy bits, especially with what it does with exceptions (swallows them!) There are other libraries out there that are a bit more idiomatic in how the Futures are composable and the exceptions are chained.

Consider moving to them.

zbard commented 8 years ago

Shouldn't it be returning https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletionException.html ? Also, exceptionally() and handle() should be able to chain actions on exceptions ?

fzakaria commented 8 years ago

@zbard i think it wasn't clear if multiple exceptionally blocks exist how they occur and the fact that the ordering of exceptionally & compose matter. I've seen other future libraries better address this.

zbard commented 8 years ago

Ah, that makes sense. Which future libraries are you thinking of ?

fzakaria commented 8 years ago

Not sure - haven't looked at options yet. I know internally at my current company they've done something similar so that's how I've come across this problem.

Farid Zakaria

On Tue, May 10, 2016 at 10:01 PM, Akshat Kumar notifications@github.com wrote:

Ah, that makes sense. Which future libraries are you thinking of ?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/fzakaria/WaterFlow/issues/1#issuecomment-218362231