diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2019-05-06 15:44:56 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2019-05-14 12:55:56 +0200 |
| commit | 5b48cdbad2493c7af9e79bb9996f195ace3123e5 (patch) | |
| tree | e7b254a5e5eb6226017e2a6c607729b8cf3cd82d /odcsim-engine-omega/src | |
| parent | 9ebe07bdbcdd7ca8f8b3c1f76a7f26b560cf2625 (diff) | |
style: Format code according to Ktlint style guide
This change formats the code according to the style guide of Ktlint.
Diffstat (limited to 'odcsim-engine-omega/src')
| -rw-r--r-- | odcsim-engine-omega/src/main/kotlin/com/atlarge/odcsim/engine/omega/OmegaActorSystem.kt | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/odcsim-engine-omega/src/main/kotlin/com/atlarge/odcsim/engine/omega/OmegaActorSystem.kt b/odcsim-engine-omega/src/main/kotlin/com/atlarge/odcsim/engine/omega/OmegaActorSystem.kt index 7e58084d..c1d487b7 100644 --- a/odcsim-engine-omega/src/main/kotlin/com/atlarge/odcsim/engine/omega/OmegaActorSystem.kt +++ b/odcsim-engine-omega/src/main/kotlin/com/atlarge/odcsim/engine/omega/OmegaActorSystem.kt @@ -88,8 +88,8 @@ class OmegaActorSystem<in T : Any>(root: Behavior<T>, override val name: String) // Start the root actor on initial run if (state == ActorSystemState.CREATED) { - registry[path]!!.isolate { it.start() } state = ActorSystemState.STARTED + registry[path]!!.isolate { it.start() } } else if (state == ActorSystemState.TERMINATED) { throw IllegalStateException("The ActorSystem has been terminated.") } @@ -106,6 +106,7 @@ class OmegaActorSystem<in T : Any>(root: Behavior<T>, override val name: String) queue.poll() val actor = registry[envelope.destination] ?: continue + // Notice that messages for unknown/terminated actors are ignored for now actor.isolate { it.interpretMessage(envelope.message) } } @@ -249,8 +250,10 @@ class OmegaActorSystem<in T : Any>(root: Behavior<T>, override val name: String) /** * Internal [ActorRef] implementation for this actor system. */ - private data class ActorRefImpl<T : Any>(private val owner: OmegaActorSystem<*>, - override val path: ActorPath) : ActorRef<T> { + private data class ActorRefImpl<T : Any>( + private val owner: OmegaActorSystem<*>, + override val path: ActorPath + ) : ActorRef<T> { override fun toString(): String = "Actor[$path]" override fun compareTo(other: ActorRef<*>): Int = path.compareTo(other.path) @@ -264,10 +267,12 @@ class OmegaActorSystem<in T : Any>(root: Behavior<T>, override val name: String) * @property time The point in time to deliver the message. * @property message The message to wrap. */ - private class EnvelopeImpl(val id: Long, - val destination: ActorPath, - override val time: Instant, - override val message: Any) : Envelope<Any> + private class EnvelopeImpl( + val id: Long, + val destination: ActorPath, + override val time: Instant, + override val message: Any + ) : Envelope<Any> /** * Schedule a message to be processed by the engine. |
