Tagged articles
112 articles
Page 2 of 2
Top Architect
Top Architect
Apr 7, 2021 · Backend Development

20 Practical Examples of Using Java CompletableFuture for Asynchronous Programming

This article introduces Java's CompletableFuture and CompletionStage APIs, explains their contracts, and provides twenty concise code examples that demonstrate creating completed futures, running async stages, applying functions synchronously and asynchronously, handling exceptions, combining futures, using custom executors, and orchestrating multiple stages with allOf/anyOf.

AsynchronousCompletableFutureCompletionStage
0 likes · 16 min read
20 Practical Examples of Using Java CompletableFuture for Asynchronous Programming
Alibaba Cloud Developer
Alibaba Cloud Developer
Feb 23, 2021 · Backend Development

From Synchronous HTTP to CompletableFuture: Mastering Async in Java

This article walks through the evolution of Java asynchronous programming, starting with a simple synchronous HTTP call, examining blocking I/O, exploring JDK NIO and Future, demonstrating callback patterns, addressing callback hell, and showing how CompletableFuture, Vert.x Future, Reactive Streams, and Spring WebFlux provide scalable, non‑blocking solutions.

CompletableFutureJavaReactive Streams
0 likes · 10 min read
From Synchronous HTTP to CompletableFuture: Mastering Async in Java
Programmer DD
Programmer DD
Dec 12, 2020 · Backend Development

Mastering Asynchronous Java: From Threads to CompletableFuture

This article explains asynchronous and non‑blocking concepts, why traditional synchronous code hurts performance, and walks through Java's evolution from raw Thread usage to Future and the powerful CompletableFuture API, including practical examples, pros, cons, and web‑framework support.

AsyncCompletableFutureFuture
0 likes · 11 min read
Mastering Asynchronous Java: From Threads to CompletableFuture
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Oct 12, 2020 · Fundamentals

Ordered Thread Execution in Java: join, CountDownLatch, Single Thread Pool, and CompletableFuture

This article explains how to enforce a specific execution order among three Java threads—first thread 1, then thread 2, and finally thread 3—using four techniques: the join method, CountDownLatch, a single‑thread executor, and CompletableFuture, each illustrated with complete code examples.

CompletableFutureCountDownLatchJOIN
0 likes · 6 min read
Ordered Thread Execution in Java: join, CountDownLatch, Single Thread Pool, and CompletableFuture
Youzan Coder
Youzan Coder
Sep 23, 2020 · Backend Development

Why Did My Dubbo Thread Pool Deadlock? A Deep Dive into CompletableFuture Blocking

The article analyzes a production incident where a Dubbo thread pool exhausted its threads due to CompletableFuture#join blocking, explains how the custom business thread pool caused mutual waiting, and presents a solution that isolates asynchronous tasks into a separate pool to restore service stability.

BackendCompletableFutureDubbo
0 likes · 9 min read
Why Did My Dubbo Thread Pool Deadlock? A Deep Dive into CompletableFuture Blocking
Top Architect
Top Architect
Sep 7, 2020 · Backend Development

Understanding Java 8 CompletionStage and CompletableFuture with Practical Examples

This article introduces Java 8's CompletionStage API and its CompletableFuture implementation, explains the contract of CompletionStage, and demonstrates a wide range of synchronous and asynchronous operations—including creation, chaining, exception handling, combinators, and real‑world usage—through concise code examples.

AsynchronousCompletableFutureCompletionStage
0 likes · 16 min read
Understanding Java 8 CompletionStage and CompletableFuture with Practical Examples
Programmer DD
Programmer DD
Aug 24, 2020 · Backend Development

Mastering Java CompletableFuture: 20 Practical Async Examples

This article explains how Java's CompletableFuture and CompletionStage APIs enable asynchronous programming without external libraries, providing detailed explanations and 20 code examples that cover creation, chaining, combining, exception handling, cancellation, and execution with custom executors.

BackendCompletableFutureasynchronous programming
0 likes · 19 min read
Mastering Java CompletableFuture: 20 Practical Async Examples
Full-Stack Internet Architecture
Full-Stack Internet Architecture
May 13, 2020 · Fundamentals

Java 8 New Features and Functional Programming Overview

An extensive guide to Java 8’s new capabilities, covering lambda expressions, functional interfaces, streams, default methods, Optional, CompletableFuture, the new date‑time API, concurrency enhancements, and numerous language and library improvements, with detailed explanations and code examples.

CompletableFutureFunctional InterfacesJava 8
0 likes · 51 min read
Java 8 New Features and Functional Programming Overview
Programmer DD
Programmer DD
Jan 10, 2020 · Backend Development

Unlocking Java’s FutureTask: A Deep Dive into Asynchronous Programming

This article explains how to use JDK’s Future and FutureTask for asynchronous computation, walks through their APIs, internal state machine, core methods like run(), get(), cancel(), and highlights their limitations while introducing CompletableFuture as a more powerful alternative.

AsynchronousCompletableFutureFutureTask
0 likes · 25 min read
Unlocking Java’s FutureTask: A Deep Dive into Asynchronous Programming
Programmer DD
Programmer DD
Jul 11, 2019 · Backend Development

Escaping Callback Hell: From Blocking Calls to Reactive Streams in Kotlin

This article explains the code types involved in synchronous remote calls, demonstrates how blocking IO leads to callback hell, and shows how to simplify the programming model using Java CompletableFuture, AsyncHttpClient, and Project Reactor’s reactive streams to efficiently retrieve city data.

AsyncHttpClientCompletableFutureKotlin
0 likes · 9 min read
Escaping Callback Hell: From Blocking Calls to Reactive Streams in Kotlin
Programmer DD
Programmer DD
Oct 9, 2018 · Backend Development

Master Java Parallelism: From CountDownLatch to Fork/Join and Beyond

This article explores the evolution of parallel computing in Java, explaining why single‑core performance stalls, how multi‑core CPUs and GPUs enable true concurrency, and demonstrating practical implementations using CountDownLatch, CompletableFuture, Fork/Join, parallel streams, and sharding, while highlighting performance considerations and pitfalls.

CompletableFutureCountDownLatchForkJoinPool
0 likes · 15 min read
Master Java Parallelism: From CountDownLatch to Fork/Join and Beyond