summaryrefslogtreecommitdiff
path: root/opendc-compute/opendc-compute-simulator
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-11-01 10:38:26 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-11-27 20:49:33 +0000
commit6bbfbd7aeb99475308a140222316f3e9006aeec3 (patch)
treeab590fa208cb98edd419fa55873a01d17ee67433 /opendc-compute/opendc-compute-simulator
parent2ca72c0b62e08efd244eba1723bc4fc65d30eed2 (diff)
refactor(compute/api): Do not suspend in compute API
This change updates the API interface of the OpenDC Compute service to not suspend execution using Kotlin Coroutines. The suspending modifiers were introduced in case the ComputeClient would communicate with the service over a network connection. However, the main use-case has been together with the ComputeService, where the suspending modifiers only frustrate the user experience when writing experiments. Furthermore, with the advent of Project Loom, it is not necessarily a problem to block the (virtual) thread during network communications.
Diffstat (limited to 'opendc-compute/opendc-compute-simulator')
-rw-r--r--opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt16
1 files changed, 8 insertions, 8 deletions
diff --git a/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt b/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt
index a496cc99..1734daf5 100644
--- a/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt
+++ b/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt
@@ -305,11 +305,11 @@ internal class SimHostTest {
override val labels: Map<String, String> = emptyMap()
override val meta: Map<String, Any> = emptyMap()
- override suspend fun delete() {
+ override fun delete() {
throw NotImplementedError()
}
- override suspend fun refresh() {
+ override fun reload() {
throw NotImplementedError()
}
}
@@ -320,11 +320,11 @@ internal class SimHostTest {
override val labels: Map<String, String>,
override val meta: Map<String, Any>
) : Image {
- override suspend fun delete() {
+ override fun delete() {
throw NotImplementedError()
}
- override suspend fun refresh() {
+ override fun reload() {
throw NotImplementedError()
}
}
@@ -343,16 +343,16 @@ internal class SimHostTest {
override val launchedAt: Instant? = null
- override suspend fun start() {}
+ override fun start() {}
- override suspend fun stop() {}
+ override fun stop() {}
- override suspend fun delete() {}
+ override fun delete() {}
override fun watch(watcher: ServerWatcher) {}
override fun unwatch(watcher: ServerWatcher) {}
- override suspend fun refresh() {}
+ override fun reload() {}
}
}