Skip to content

Commit

Permalink
#xoá import và thêm ví dụ stop parent sẽ stop child
Browse files Browse the repository at this point in the history
  • Loading branch information
phuvh committed Jun 30, 2022
1 parent be2b22e commit 20a025f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/main/kotlin/org/magicghostvu/actor/Behavior.kt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/org/magicghostvu/actor/Behaviors.kt
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ object Behaviors {
return MActorRef(internalChannel as SendChannel<T>)
}


fun <T> CoroutineScope.spawnChild(
@OptIn(ObsoleteCoroutinesApi::class)
fun <T> ActorScope<T>.spawnChild(
debug: Boolean = false,
factory: suspend () -> Behavior<T>
): MActorRef<T> {
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/org/magicghostvu/run/RunActor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ fun main(arr: Array<String>) {
}
parent.tell(Msg1())

/*delay(5000)
parent.tell(Msg4())*/
delay(5000)
parent.tell(Msg4())

}
}

0 comments on commit 20a025f

Please sign in to comment.