From d40eae0264236be3a9d34f39a63adde8a9b47a57 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Fri, 14 Feb 2020 00:44:43 +0100 Subject: feat: Make ProcessContext a coroutine scope This change makes the ProcessContext implement the CoroutineScope in order to launch local coroutines bound to the lifecycle of the logical process. --- .../kotlin/com/atlarge/odcsim/engine/omega/OmegaSimulationEngine.kt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'odcsim/odcsim-engine-omega/src') diff --git a/odcsim/odcsim-engine-omega/src/main/kotlin/com/atlarge/odcsim/engine/omega/OmegaSimulationEngine.kt b/odcsim/odcsim-engine-omega/src/main/kotlin/com/atlarge/odcsim/engine/omega/OmegaSimulationEngine.kt index 7a147291..207d2768 100644 --- a/odcsim/odcsim-engine-omega/src/main/kotlin/com/atlarge/odcsim/engine/omega/OmegaSimulationEngine.kt +++ b/odcsim/odcsim-engine-omega/src/main/kotlin/com/atlarge/odcsim/engine/omega/OmegaSimulationEngine.kt @@ -232,6 +232,10 @@ class OmegaSimulationEngine(rootBehavior: Behavior, override val name: String) : override val key: CoroutineContext.Key<*> = ProcessContext.Key + @InternalCoroutinesApi + override val coroutineContext: CoroutineContext + get() = context + @InternalCoroutinesApi override val context: CoroutineContext = this + dispatcher + job } -- cgit v1.2.3