summaryrefslogtreecommitdiff
path: root/opendc-core/src
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-core/src')
-rw-r--r--opendc-core/src/main/kotlin/com/atlarge/opendc/simulator/Context.kt8
1 files changed, 8 insertions, 0 deletions
diff --git a/opendc-core/src/main/kotlin/com/atlarge/opendc/simulator/Context.kt b/opendc-core/src/main/kotlin/com/atlarge/opendc/simulator/Context.kt
index c89bdb59..13170256 100644
--- a/opendc-core/src/main/kotlin/com/atlarge/opendc/simulator/Context.kt
+++ b/opendc-core/src/main/kotlin/com/atlarge/opendc/simulator/Context.kt
@@ -51,6 +51,14 @@ interface Context<S, out M> {
val delta: Duration
/**
+ * The sender of the last received message or `null` in case the process has not received any messages yet.
+ *
+ * Note that this property is only guaranteed to be correct when accessing after a single suspending call. Methods
+ * like `hold()` and `interrupt()` may change the value of this property.
+ */
+ val sender: Entity<*, *>?
+
+ /**
* The observable state of the entity bound to this scope.
*/
var state: S