Fork me on GitHub
#graphql
<
2020-02-08
>
hiredman00:02:33

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: https://github.com/walmartlabs/lacinia/compare/master...hiredman:master 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

hlship00:02:29

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.

hiredman00:02:21

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)

hiredman00:02:07

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