From d716eac07ffcec7d94f3a960a03686b1a738ad56 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sun, 10 Jan 2021 19:19:04 +0300 Subject: [PATCH] fix build inconsistencies --- .../kotlin/hep/dataforge/control/client/magixClient.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dataforge-magix-client/src/commonMain/kotlin/hep/dataforge/control/client/magixClient.kt b/dataforge-magix-client/src/commonMain/kotlin/hep/dataforge/control/client/magixClient.kt index 0f35863..6e7a908 100644 --- a/dataforge-magix-client/src/commonMain/kotlin/hep/dataforge/control/client/magixClient.kt +++ b/dataforge-magix-client/src/commonMain/kotlin/hep/dataforge/control/client/magixClient.kt @@ -5,6 +5,7 @@ import hep.dataforge.control.controllers.respondMessage import hep.dataforge.control.messages.DeviceMessage import hep.dataforge.magix.api.MagixEndpoint import hep.dataforge.magix.api.MagixMessage +import hep.dataforge.magix.api.MagixProcessor import kotlinx.coroutines.Job import kotlinx.coroutines.flow.catch import kotlinx.coroutines.flow.launchIn @@ -41,9 +42,9 @@ public fun DeviceManager.launchMagixClient( endpoint.broadcast(DeviceMessage.serializer(), response) }.catch { error -> logger.error(error){"Error while responding to message"} - }.launchIn(endpoint.scope) + }.launchIn(this) - controller.messageOutput.onEach { payload -> + controller.messageOutput().onEach { payload -> MagixMessage( format = DATAFORGE_MAGIX_FORMAT, id = "df[${payload.hashCode()}]", @@ -52,7 +53,7 @@ public fun DeviceManager.launchMagixClient( ) }.catch { error -> logger.error(error){"Error while sending a message"} - }.launchIn(endpoint.scope) + }.launchIn(this) } public fun DeviceManager.asMagixProcessor(endpointID: String = "dataforge"): MagixProcessor = object : MagixProcessor {