Skip to content

Commit cb9cb44

Browse files
committed
fix: update structured concurrency example to Java 26 Joiner API
Signed-off-by: https://github.com/Someshdiwan <someshdiwan369@gmail.com>
1 parent c86886c commit cb9cb44

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Java-Versions/Java 26/src/Test1.java renamed to Java-Versions/Java 26/src/StructuredConcurrencyDemo.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import java.util.concurrent.StructuredTaskScope;
22

3-
public class Test1 {
3+
public class StructuredConcurrencyDemo {
44
public static void main(String[] args) {
55

66
try (var scope = new StructuredTaskScope.ShutdownOnFailure()) {
@@ -28,6 +28,12 @@ static String fetchData(String name) throws InterruptedException {
2828
/*
2929
What changed: Previous vs New
3030
31+
Java 26 note:
32+
StructuredTaskScope API changed from older ShutdownOnFailure style
33+
to the new open(...) + Joiner style.
34+
35+
36+
3137
Previous Java style:
3238
- Usually we used ExecutorService + Future
3339
- We manually submitted tasks

0 commit comments

Comments
 (0)