Fork me on GitHub

I've recently started to play around with some of the newer additions to juc, and tried swapping out lacina's promise implementation with a CompletableFuture: it mostly works, a few tests fail, the execution model isn't exactly the same because with CompletableFuture you can't execute things on the same thread, and it allows multiple callbacks to be registered. Actually making the switch is likely to be kind of risky because of the changes to the execution model, that kind of thing is easy to get tripped up on, but it is interesting to look at


What's the advantage of CompleteableFuture vs. Lacinia promises? The "limitations" of RRP (like single deliver!) were chosen to prevent certain common mistakes from being possible.


the only big one I can think of would be interoperability, since CompleteableFuture is built into the jvm, other libraries are more likely to support it, but that may take a while (it was added in 1.8 and I still think of it as being a new thing)


but, even if lacina itself doesn't use CompletableFuture it is easy enough to extend the protocols to it