pawelbochenski
12/19/2018, 7:18 AMbdawg.io
12/19/2018, 7:23 AMpawelbochenski
12/19/2018, 7:24 AMdave08
12/19/2018, 7:27 AMsuspendCancellableCoroutine { }
see the coroutines KEEP in the repo, it explains how to wrap callbacks.pawelbochenski
12/19/2018, 7:38 AMgildor
12/19/2018, 7:39 AMsend()
(requires runBlocking, or starting coroutine) or offer
dave08
12/19/2018, 7:42 AMproduce { }
?gildor
12/19/2018, 7:42 AMpawelbochenski
12/19/2018, 7:48 AMfun subscribe(topic: String): Channel<String> {
val channel = Channel<String>()
client.subscribe(topic) { _, message ->
channel.offer(message.toString())
}
return channel
}
gildor
12/19/2018, 7:51 AMpawelbochenski
12/19/2018, 7:55 AMstreetsofboston
12/19/2018, 1:03 PM