Skip to content

Commit a7ef770

Browse files
author
Luca Venturi
committed
Changes a test to make it run on JDK 21
1 parent aa3e9f4 commit a7ef770

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test/java/eu/lucaventuri/examples/AutoHealingExample.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import eu.lucaventuri.common.SystemUtils;
44
import eu.lucaventuri.fibry.ActorSystem;
5+
import eu.lucaventuri.fibry.CreationStrategy;
56
import eu.lucaventuri.fibry.HealRegistry;
67

78
import java.util.concurrent.ExecutionException;
@@ -14,7 +15,7 @@ public static void main(String[] args) throws ExecutionException, InterruptedExc
1415
HealRegistry.INSTANCE.setFrequency(1, TimeUnit.SECONDS);
1516
HealRegistry.INSTANCE.setGracePeriod(1, TimeUnit.SECONDS);
1617

17-
var actor = ActorSystem.anonymous().autoHealing(new ActorSystem.AutoHealingSettings(3, 5, (e) -> System.out.println("Notification by AutoHealing - Interruption"), () -> System.out.println("Notification by AutoHealing - New Thread"))).newActor((Long time) -> {
18+
var actor = ActorSystem.anonymous().strategy(CreationStrategy.THREAD).autoHealing(new ActorSystem.AutoHealingSettings(3, 5, (e) -> System.out.println("Notification by AutoHealing - Interruption"), () -> System.out.println("Notification by AutoHealing - New Thread"))).newActor((Long time) -> {
1819
System.out.println("Waiting for " + time + ": " + Thread.currentThread().getName() + " - " + Thread.currentThread().getId());
1920
SystemUtils.sleepEnsure(time);
2021
});

0 commit comments

Comments
 (0)