From 4e6920d5c128b49750408a11850dfa6a7abb1e9e Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Thu, 25 Apr 2019 21:28:10 +0200 Subject: feat: Add support for ActorSystem termination This change adds support for terminating an ActorSystem. --- odcsim-core/src/main/kotlin/com/atlarge/odcsim/ActorSystem.kt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'odcsim-core/src') diff --git a/odcsim-core/src/main/kotlin/com/atlarge/odcsim/ActorSystem.kt b/odcsim-core/src/main/kotlin/com/atlarge/odcsim/ActorSystem.kt index cbb80541..bae1fb74 100644 --- a/odcsim-core/src/main/kotlin/com/atlarge/odcsim/ActorSystem.kt +++ b/odcsim-core/src/main/kotlin/com/atlarge/odcsim/ActorSystem.kt @@ -57,4 +57,13 @@ interface ActorSystem : ActorRef { * @param after The delay after which the message should be received by the actor. */ fun send(msg: T, after: Duration = 0.1) + + /** + * Terminates this actor system. + * + * This will stop the root actor and in turn will recursively stop all its child actors. + * + * This is an asynchronous operation. + */ + fun terminate() } -- cgit v1.2.3