Skip to content
Advertisement

Tag: completable-future

Mono vs CompletableFuture

CompletableFuture executes a task on a separate thread ( uses a thread-pool ) and provides a callback function. Let’s say I have an API call in a CompletableFuture. Is that an API call blocking? Would the thread be blocked till it does not get a response from the API? ( I know main thread/tomcat thread will be non-blocking, but what

“Double” composition with CompletableFuture

I’m trying to avoid nesting CompletableFuture when combining 2 independent ones with a BiFunction that returns a third one. Currently, using thenCombine() does not cut it: I’m basically trying to find a way that looks like haskell if there was a CompletableFuture monad: I read somewhere that join() is the flatMap of Completable future, so I think I could use

Advertisement