Interface StructuredTaskScope.Subtask<T>

Type Parameters:
T - the result type
All Superinterfaces:
Supplier<T>
Enclosing interface:
StructuredTaskScopePREVIEW<T,R>

public static sealed interface StructuredTaskScope.Subtask<T> extends Supplier<T>
Subtask is a preview API of the Java platform.
Programs can only use Subtask when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Represents a subtask forked with StructuredTaskScope.fork(Callable)PREVIEW or StructuredTaskScope.fork(Runnable)PREVIEW.

Code that forks subtasks can use the get() method after joiningPREVIEW to obtain the result of a subtask that completed successfully. It can use the exception() method to obtain the exception thrown by a subtask that failed.

Since:
21