File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed
src/main/java/net/codetojoy Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 66
77- egg5
88 - ok for bash, Maven
9+ - egg6
10+ - ok for bash, Maven
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ TARGET_DIR=$ROOT_DIR/my_build/main
1010
1111mkdir -p $TARGET_DIR
1212
13- javac --release 21 --enable-preview \
13+ javac --release 25 --enable-preview \
1414-cp $CLASSPATH \
1515-d $TARGET_DIR ` find $SRC_DIR -name " *.java" `
1616
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ CLASSPATH=$CLASSPATH:$TARGET_DIR
99
1010java --enable-preview \
1111-cp $CLASSPATH \
12- --add-modules jdk.incubator.concurrent \
1312net.codetojoy.Runner
1413
1514echo " run complete"
Original file line number Diff line number Diff line change 44
55import java .time .Duration ;
66import java .util .concurrent .*;
7+ import java .util .concurrent .StructuredTaskScope .Joiner ;
78
89public class Runner {
910 int taskFooDelayInMillis = 2000 ;
@@ -30,13 +31,11 @@ String taskBar() {
3031 }
3132
3233 String run () throws Exception {
33- try (var scope = new StructuredTaskScope .ShutdownOnSuccess <String >( )) {
34+ try (var scope = StructuredTaskScope .open ( Joiner . <String >anySuccessfulResultOrThrow () )) {
3435 var foo = scope .fork (() -> taskFoo ());
3536 var bar = scope .fork (() -> taskBar ());
3637
37- scope .join ();
38-
39- return scope .result ();
38+ return scope .join ();
4039 }
4140 }
4241
You can’t perform that action at this time.
0 commit comments