Runnable demos for the ankurm.com structured-concurrency-java article: the ExecutorService thread leak and its fix, every built-in Joiner, structure violations, timeouts, a custom Joiner, JSON thread dumps (in-process and jcmd), scoped values, javap diffs of the API on 25, 26, 27 and 28-ea, compiler output for six pieces of 25/26-era code, and the preview class-file trap between 27 and 28. Transcripts in output/. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CifR2BE7PBvRy5hT8TS9oz
11 lines
539 B
Plaintext
11 lines
539 B
Plaintext
$ javac src/Unstructured.java && java Unstructured (28-beta+21-ea)
|
|
handle() failed: java.lang.IllegalStateException: user service down
|
|
handle() has returned. Waiting 400 ms to see what the other thread does:
|
|
fetchOrder() finished, although nobody wants the answer any more
|
|
|
|
$ javac src/FailFast.java && java FailFast (28-beta+21-ea)
|
|
fetchOrder() was interrupted
|
|
handle() failed: java.lang.IllegalStateException: user service down
|
|
handle() has returned. Waiting 400 ms to see what the other thread does:
|
|
(nothing more happened)
|