Tag

Future

1 views collected around this technical thread.

FunTester
FunTester
Jun 17, 2025 · Backend Development

How to Test Java ExecutorService Without Thread.sleep(): Reliable Strategies

This article explains why using Thread.sleep() in Java ExecutorService unit tests is unreliable and inefficient, and introduces three robust alternatives—Future.get(), CountDownLatch, and shutdown/awaitTermination—to achieve stable and performant testing of asynchronous code.

CountDownLatchExecutorServiceFuture
0 likes · 13 min read
How to Test Java ExecutorService Without Thread.sleep(): Reliable Strategies
FunTester
FunTester
Apr 9, 2025 · Backend Development

Understanding Future and CompletableFuture in Java for Asynchronous Programming

This article explains the concepts, differences, and practical usage of Java's Future and CompletableFuture for asynchronous programming, highlighting their blocking behavior, task composition, exception handling, and suitable scenarios in performance testing and complex test workflows, with detailed code examples.

Asynchronous ProgrammingCompletableFutureFuture
0 likes · 14 min read
Understanding Future and CompletableFuture in Java for Asynchronous Programming
macrozheng
macrozheng
Feb 6, 2025 · Backend Development

Mastering Java Async: Future, Callable, CompletableFuture, and FutureTask Explained

This article explores four Java asynchronous programming approaches—Future with Callable, CompletableFuture, and FutureTask—detailing their principles, usage patterns, code examples, and how to retrieve results from thread pools, helping developers improve performance for tasks like aggregating order and fee summaries.

CallableCompletableFutureFuture
0 likes · 12 min read
Mastering Java Async: Future, Callable, CompletableFuture, and FutureTask Explained
Code Ape Tech Column
Code Ape Tech Column
Feb 5, 2025 · Backend Development

Handling Exceptions in Java ThreadPool: submit vs execute and Custom Solutions

This article explains why exceptions submitted to a Java thread pool via submit are silent, how to retrieve them using Future.get(), compares submit and execute behaviors, and presents three practical solutions—including try‑catch, Thread.setDefaultUncaughtExceptionHandler, and overriding afterExecute—to reliably capture and process thread pool errors.

Exception HandlingExecutorServiceFuture
0 likes · 14 min read
Handling Exceptions in Java ThreadPool: submit vs execute and Custom Solutions
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Jan 25, 2025 · Backend Development

Mastering CompletableFuture in Java: Basics, Advanced Features, and Best Practices

This comprehensive guide introduces Java's CompletableFuture, explains its advantages over the traditional Future API, demonstrates how to create and compose asynchronous tasks, manage thread pools, handle timeouts and cancellations, and apply robust exception handling techniques for reliable concurrent programming.

Asynchronous ProgrammingCompletableFutureException Handling
0 likes · 16 min read
Mastering CompletableFuture in Java: Basics, Advanced Features, and Best Practices
Architecture Digest
Architecture Digest
Jan 23, 2025 · Backend Development

Using Future, Callable, CompletableFuture, and FutureTask for Asynchronous Tasks in Java

This article explains how to improve backend performance by fetching independent report data concurrently using Java's Future, Callable, CompletableFuture, and FutureTask classes, provides code examples for each approach, and compares their principles, usage patterns, and cancellation capabilities.

CallableCompletableFutureFuture
0 likes · 9 min read
Using Future, Callable, CompletableFuture, and FutureTask for Asynchronous Tasks in Java
Architect's Guide
Architect's Guide
Aug 25, 2024 · Backend Development

Eight Ways to Implement Asynchronous Execution in Java

This article introduces eight common Java asynchronous implementation techniques—including raw threads, Future, CompletableFuture, Spring @Async, ApplicationEvent, message queues, third‑party utilities like Hutool ThreadUtil and Guava ListenableFuture—explaining their usage, code examples, advantages, and drawbacks for improving performance in scenarios such as sending SMS or emails.

CompletableFutureFutureGuava
0 likes · 14 min read
Eight Ways to Implement Asynchronous Execution in Java
Code Mala Tang
Code Mala Tang
Aug 17, 2024 · Artificial Intelligence

What Eric Schmidt Says About AI’s Future, Competition, and Industry Shifts

In a candid Stanford talk, former Google CEO Eric Schmidt warned that AI breakthroughs demand massive investment, larger context windows, and aggressive talent strategies, while highlighting CUDA's dominance, the rise of AI agents, geopolitical energy concerns, and the need for organizational innovation to unlock AI's full potential.

AIFutureIndustry
0 likes · 37 min read
What Eric Schmidt Says About AI’s Future, Competition, and Industry Shifts
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Mar 6, 2024 · Backend Development

Mastering Java 8 CompletableFuture: Async Patterns and Best Practices

This article introduces Java 8's CompletableFuture class, compares it with Future, demonstrates basic Future usage, then explores advanced asynchronous patterns—including CompletionService, chaining, exception handling, combining tasks, and various utility methods—providing code examples and execution results to illustrate each concept.

CompletableFutureExecutorServiceFuture
0 likes · 15 min read
Mastering Java 8 CompletableFuture: Async Patterns and Best Practices
Architect's Guide
Architect's Guide
Feb 9, 2024 · Backend Development

How to Capture Exceptions from Java ThreadPool Tasks: submit vs execute and Three Solutions

This article explains why exceptions from tasks submitted to a Java ThreadPool using submit are not printed, how execute shows them, and presents three practical approaches—try‑catch within the task, a custom Thread.setDefaultUncaughtExceptionHandler, and overriding afterExecute—to reliably obtain and handle those exceptions.

ExceptionHandlingExecutorServiceFuture
0 likes · 14 min read
How to Capture Exceptions from Java ThreadPool Tasks: submit vs execute and Three Solutions
Code Ape Tech Column
Code Ape Tech Column
Nov 21, 2023 · Backend Development

Understanding Java CompletionService: Prioritizing the First Completed Task

This article explains the purpose and implementation of Java's CompletionService, compares it with ExecutorService, walks through its source code and key methods, and demonstrates typical usage patterns for efficiently retrieving the earliest completed asynchronous results.

CompletionServiceExecutorServiceFuture
0 likes · 12 min read
Understanding Java CompletionService: Prioritizing the First Completed Task
Selected Java Interview Questions
Selected Java Interview Questions
Nov 18, 2023 · Backend Development

A Comprehensive Guide to Java CompletableFuture: Replacing Future and CountDownLatch with Elegant Asynchronous Patterns

This article explains Java's Future and CompletableFuture APIs, demonstrates how to replace blocking Future.get() and CountDownLatch patterns with CompletableFuture, shows creation methods, result retrieval options, callback chains, exception handling, task composition techniques, and provides best‑practice recommendations for thread‑pool usage.

CompletableFutureExceptionHandlingFuture
0 likes · 22 min read
A Comprehensive Guide to Java CompletableFuture: Replacing Future and CountDownLatch with Elegant Asynchronous Patterns
Sanyou's Java Diary
Sanyou's Java Diary
Oct 26, 2023 · Backend Development

Master Asynchronous Java: Threads, Futures, CompletableFuture & @Async

Explore the fundamentals and advanced techniques of asynchronous programming in Java, from basic thread creation and thread pools to Future, FutureTask, CompletableFuture, and Spring Boot’s @Async annotation, including practical code examples, event handling, and message queue integration for high‑throughput systems.

Asynchronous ProgrammingCompletableFutureFuture
0 likes · 17 min read
Master Asynchronous Java: Threads, Futures, CompletableFuture & @Async
Selected Java Interview Questions
Selected Java Interview Questions
Sep 28, 2023 · Backend Development

Using CompletableFuture for Asynchronous Programming in Java: Examples, APIs, and Best Practices

This article explains how Java's Future and CompletableFuture interfaces enable asynchronous task execution, demonstrates common pitfalls of Future, shows how to replace it with CompletableFuture for more elegant code, and covers creation methods, result retrieval, callback chaining, task composition, and practical usage tips.

CompletableFutureException HandlingFuture
0 likes · 20 min read
Using CompletableFuture for Asynchronous Programming in Java: Examples, APIs, and Best Practices
macrozheng
macrozheng
Sep 27, 2023 · Backend Development

Master Java CompletableFuture: From Basics to Advanced Async Patterns

This comprehensive guide explains Java's CompletableFuture API, covering its fundamentals, creation methods, chaining operations, exception handling, and best practices for parallel execution, while providing clear code examples and performance tips for building efficient asynchronous workflows in backend development.

Asynchronous ProgrammingBackend DevelopmentCompletableFuture
0 likes · 20 min read
Master Java CompletableFuture: From Basics to Advanced Async Patterns
Java Architect Essentials
Java Architect Essentials
Sep 4, 2023 · Backend Development

Using CompletableFuture for Asynchronous Programming in Java: Examples and Best Practices

This article explains Java asynchronous programming by first showing the limitations of the JDK5 Future interface, then demonstrating how CountDownLatch can coordinate tasks, and finally presenting CompletableFuture creation, result retrieval, callback chaining, exception handling, and multi‑task composition with practical code examples.

CompletableFutureExceptionHandlingFuture
0 likes · 20 min read
Using CompletableFuture for Asynchronous Programming in Java: Examples and Best Practices
Top Architect
Top Architect
Jun 20, 2023 · Backend Development

Eight Ways to Implement Asynchronous Programming in Java

This article introduces eight practical approaches for achieving asynchronous execution in Java—including raw threads, Future, CompletableFuture, Spring @Async, ApplicationEvent, message queues, Hutool ThreadUtil, and Guava ListenableFuture—providing code samples, configuration tips, and discussion of each method's advantages and drawbacks.

CompletableFutureFutureJava
0 likes · 14 min read
Eight Ways to Implement Asynchronous Programming in Java
Architect's Guide
Architect's Guide
May 12, 2023 · Backend Development

Eight Ways to Implement Asynchronous Programming in Java

This article introduces the concept of asynchronous execution and presents eight practical Java implementations—including Thread, Future, CompletableFuture, Spring @Async, ApplicationEvent, message queues, ThreadUtil, and Guava ListenableFuture—along with code examples and usage tips for each method.

CompletableFutureFutureJava
0 likes · 12 min read
Eight Ways to Implement Asynchronous Programming in Java
Architect's Guide
Architect's Guide
Mar 18, 2023 · Backend Development

Eight Ways to Implement Asynchronous Execution in Java

This article introduces eight common methods for implementing asynchronous execution in Java, including threads, Future, CompletableFuture, Spring @Async, ApplicationEvent, message queues, Hutool ThreadUtil, and Guava ListenableFuture, and provides code examples and usage considerations.

CompletableFutureFutureJava
0 likes · 14 min read
Eight Ways to Implement Asynchronous Execution in Java
Architect
Architect
Mar 1, 2023 · Backend Development

Eight Asynchronous Programming Techniques in Java

This article introduces eight common methods for achieving asynchronous execution in Java, including raw threads, Future, CompletableFuture, Spring @Async, ApplicationEvent, message queues, ThreadUtil, and Guava ListenableFuture, explaining their usage, advantages, and limitations.

CompletableFutureFutureGuava
0 likes · 10 min read
Eight Asynchronous Programming Techniques in Java