diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-09-28 11:58:19 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-10-03 17:17:37 +0200 |
| commit | 02fa44c0b116ff51c4cbe2876d8b2a225ed68553 (patch) | |
| tree | 38562ef2e6f3cde4e46ad5eb32d7573cebaabef6 /opendc-simulator/opendc-simulator-network/src | |
| parent | d575bed5418be222e1d3ad39af862e2390596d61 (diff) | |
refactor(simulator): Add support for pushing flow from context
This change adds a new method to `SimResourceContext` called `push`
which allows users to change the requested flow rate directly without
having to interrupt the consumer.
Diffstat (limited to 'opendc-simulator/opendc-simulator-network/src')
| -rw-r--r-- | opendc-simulator/opendc-simulator-network/src/main/kotlin/org/opendc/simulator/network/SimNetworkSink.kt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/opendc-simulator/opendc-simulator-network/src/main/kotlin/org/opendc/simulator/network/SimNetworkSink.kt b/opendc-simulator/opendc-simulator-network/src/main/kotlin/org/opendc/simulator/network/SimNetworkSink.kt index f2dd8455..7db0f176 100644 --- a/opendc-simulator/opendc-simulator-network/src/main/kotlin/org/opendc/simulator/network/SimNetworkSink.kt +++ b/opendc-simulator/opendc-simulator-network/src/main/kotlin/org/opendc/simulator/network/SimNetworkSink.kt @@ -32,7 +32,7 @@ public class SimNetworkSink( public val capacity: Double ) : SimNetworkPort() { override fun createConsumer(): SimResourceConsumer = object : SimResourceConsumer { - override fun onNext(ctx: SimResourceContext, now: Long, delta: Long): SimResourceCommand = SimResourceCommand.Consume(0.0) + override fun onNext(ctx: SimResourceContext, now: Long, delta: Long): Long = Long.MAX_VALUE override fun toString(): String = "SimNetworkSink.Consumer" } |
