From 872c84d3f343e71ce98befa13cdb5e39ebd822ec Mon Sep 17 00:00:00 2001 From: Torma Date: Wed, 21 Oct 2020 18:18:20 +0200 Subject: [PATCH] make main blocking --- src/main/kotlin/Main.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/Main.kt b/src/main/kotlin/Main.kt index db5e4ce..d82904f 100644 --- a/src/main/kotlin/Main.kt +++ b/src/main/kotlin/Main.kt @@ -1,12 +1,14 @@ import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.delay import kotlinx.coroutines.launch +import kotlinx.coroutines.runBlocking -fun main(){ +fun main() = runBlocking{ GlobalScope.launch { val mqtt = MqttSubscriber() mqtt.connect() delay(10000L) mqtt.disconnect() } + delay(20000L) } \ No newline at end of file