We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e12f46f commit cc08fa4Copy full SHA for cc08fa4
1 file changed
README.md
@@ -39,7 +39,10 @@ class Test {
39
// The main thread executes CompletableFuture tasks, avoiding the use of ForkJoinPool
40
public void usingCompletableFuture() {
41
CurrentThreadExecutor executor = new CurrentThreadExecutor();
42
- CompletableFuture<String> voidCompletableFuture = CompletableFuture.supplyAsync(() -> "Hello " + Thread.currentThread().getName(), executor);
+ CompletableFuture<String> voidCompletableFuture = CompletableFuture.supplyAsync(() -> {
43
+ // main thread
44
+ return "Hello " + Thread.currentThread().getName();
45
+ }, executor);
46
String hello = executor.start(voidCompletableFuture);
47
System.out.println(hello); // Hello main
48
}
0 commit comments