diff --git a/src/main/kotlin/org/magicghostvu/actor/Behavior.kt b/src/main/kotlin/org/magicghostvu/actor/Behavior.kt index 5d83550..aad02bd 100644 --- a/src/main/kotlin/org/magicghostvu/actor/Behavior.kt +++ b/src/main/kotlin/org/magicghostvu/actor/Behavior.kt @@ -1,6 +1,5 @@ package org.magicghostvu.actor -import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.ObsoleteCoroutinesApi import kotlinx.coroutines.channels.ActorScope import kotlinx.coroutines.channels.SendChannel diff --git a/src/main/kotlin/org/magicghostvu/actor/Behaviors.kt b/src/main/kotlin/org/magicghostvu/actor/Behaviors.kt index ccb3b63..0e8db11 100644 --- a/src/main/kotlin/org/magicghostvu/actor/Behaviors.kt +++ b/src/main/kotlin/org/magicghostvu/actor/Behaviors.kt @@ -176,8 +176,8 @@ object Behaviors { return MActorRef(internalChannel as SendChannel) } - - fun CoroutineScope.spawnChild( + @OptIn(ObsoleteCoroutinesApi::class) + fun ActorScope.spawnChild( debug: Boolean = false, factory: suspend () -> Behavior ): MActorRef { diff --git a/src/main/kotlin/org/magicghostvu/run/RunActor.kt b/src/main/kotlin/org/magicghostvu/run/RunActor.kt index efb8643..64a2b31 100644 --- a/src/main/kotlin/org/magicghostvu/run/RunActor.kt +++ b/src/main/kotlin/org/magicghostvu/run/RunActor.kt @@ -124,8 +124,8 @@ fun main(arr: Array) { } parent.tell(Msg1()) - /*delay(5000) - parent.tell(Msg4())*/ + delay(5000) + parent.tell(Msg4()) } } \ No newline at end of file