Interface StructuredTaskScope.Config

Enclosing interface:
StructuredTaskScopePREVIEW<T,R>

public static sealed interface StructuredTaskScope.Config
Config is a preview API of the Java platform.
Programs can only use Config when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Represents the configuration for a StructuredTaskScope.

The configuration for a StructuredTaskScope consists of a ThreadFactory to create threads, an optional name for the purposes of monitoring and management, and an optional timeout.

Creating a StructuredTaskScope with StructuredTaskScope.open()PREVIEW or StructuredTaskScope.open(Joiner)PREVIEW uses the default configuration. The default configuration consists of a thread factory that creates unnamed virtual threads, no name for monitoring and management purposes, and no timeout.

Creating a StructuredTaskScope with its 2-arg openPREVIEW method allows a different configuration to be used. The function specified to the open method is applied to the default configuration and returns the configuration for the StructuredTaskScope under construction. The function can use the with- prefixed methods defined here to specify the components of the configuration to use.

Unless otherwise specified, passing a null argument to a method in this class will cause a NullPointerException to be thrown.

Since:
24