Comparing the Overview of Blocking vs. Non-Blocking with the Java Completable Futures framework.

Опубликовано: 10 Октябрь 2024
на канале: Douglas Schmidt
768
12

This example shows the difference between calling join() on intermediate Java CompletableFuture objects (which block and thus degrade performance) vs. simply making one call to join() (and thus enhancing greater parallelism). These tests demonstrate why join() shouldn't be used in a stream pipeline on a CompletableFuture that hasn't completed since it may impede parallelism.