Files
java-ai-agents/agentic-patterns/preview/ScopeProbe.java
T
2026-11-06 21:43:16 +05:30

14 lines
518 B
Java

import java.util.concurrent.StructuredTaskScope;
/** Standalone probe, not part of the Maven build: is StructuredTaskScope usable on this JDK without flags? */
public class ScopeProbe {
public static void main(String[] args) throws Exception {
try (var scope = StructuredTaskScope.open()) {
var a = scope.fork(() -> "security: ok");
var b = scope.fork(() -> "performance: ok");
scope.join();
System.out.println(a.get() + " | " + b.get());
}
}
}