On Fri, 19 Sep 2025 14:49:52 GMT, Alan Bateman <[email protected]> wrote:
> Updates for JEP 525. > > - `Joiner:onTimeout` is added with `join` method changed to invoke this > joiner method if > a timeout is configured and the timeout expires before or while waiting. > The `onTimeout` > throws `TimeoutException` or may do nothing. This allows for `Joiner` > implementation that > are capable of returning a result from the subtasks that complete before > the timeout expires. > - The `configFunction` parameter to the 3-arg `open` is changed from > `Function<Configuration, Configuration>` to `UnaryOperator<Configuration>`. > - `Subtask::get` and `Subtask::exception` changed to consistently throw if > called from > any thread before the scope owner has joined. > - `StructuredTaskScope::join` is now specified so that it may be called again > if interrupted. > - The parameter on `Joiner::onFork` and `Joiner::onComplete` is changed from > `Subtask<? extends T` to `Subtask<T>`. > - `Joiner.allSuccessOrThrow` is changed to return a list of results instead > of a stream of > subtasks. `Joiner.allUntil` is changed to return a list of subtasks. > - `Joiner.anySuccessfulResultOrThrow` is renamed to `anySuccessfulOrThrow`. > - `Joiner.allUntil(Predicate)` is changed to allow `join` return the stream > of all forked > subtasks when the timeout expires. > - `Joiner` is no longer a `@FunctionalInterface`. > > Most of the changes are to API docs and tests. Some links are changed to use > double hash mark. This pull request has now been integrated. Changeset: 0bae56b6 Author: Alan Bateman <[email protected]> URL: https://git.openjdk.org/jdk/commit/0bae56b6149f87e8ebd09291f96033d3e558263b Stats: 839 lines in 6 files changed: 526 ins; 55 del; 258 mod 8367857: Implement JEP 525: Structured Concurrency (Sixth Preview) Reviewed-by: vklang ------------- PR: https://git.openjdk.org/jdk/pull/27392
