https://kotlinlang.org logo
Title
u

user

07/17/2022, 10:01 AM
Background suspend fire and forget channel processing in Kotlin + Spring What is the correct way to rake Channel in the background? Suppose I have long polling bot with onMessage(callbackSuspendAction: suspend.() -> Unit) and this callback is a heavy computation (20-30 seconds) I put these events to the messageHandlersQueue: Channel in the following way: messageHandlersQueue.send( coroutineScope { launch(start = CoroutineStart.LAZY) { val vkClient = VkClient(actor.userActor) processVkUserQuery(msg.chat.id, addressName,...