diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2019-04-25 21:28:10 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2019-05-13 20:26:47 +0200 |
| commit | 4e6920d5c128b49750408a11850dfa6a7abb1e9e (patch) | |
| tree | cc1e718ee8a04a94c3ec7623e977fb681d47dbcf /odcsim-core | |
| parent | 38828ab3708a22bbd321c76d936648a2010f5c60 (diff) | |
feat: Add support for ActorSystem termination
This change adds support for terminating an ActorSystem.
Diffstat (limited to 'odcsim-core')
| -rw-r--r-- | odcsim-core/src/main/kotlin/com/atlarge/odcsim/ActorSystem.kt | 9 |
1 files changed, 9 insertions, 0 deletions
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<in T : Any> : ActorRef<T> { * @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() } |
