```CompletableFuture.supplyAsync(Supplier<Boole...
# functional
d
Copy code
CompletableFuture.supplyAsync(Supplier<Boolean>{
                    true
                }, pool)
so if I want the
, pool
then I need to use
Supplier<>
? there is no way to get of it ? I'm asking because if you only supply one parameter then it is not necessary
p
Well, it’s obligatory to provide a computation to run, it’s optional to provide a custom pool
So yes, you always need to pass
Supplier<T>
, pool
can be skipped but the method signature remains the same
d
I just meant I was asking if there is no way to use the nicer syntax { } that you can use when there is no pool parameter. For some reason it requires Supplier<Boolean> if a second parameter is passed
p
You can just do
CompletableFuture.supplyAsync({ true }, pool)