python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Get value from withTimeout
I'm running a coroutine that is reading from a receiverChannel. I've got this coroutine wrapped within a timeout and I want to get the number of messages it managed to read before the timeout cancels ...

Martin
Votes: 0
Answers: 1
How to define a task, run it in the future, and cancel it using Kotlin coroutines
I'm new to kotlin Coroutines. I define a Runnable and call it asynchronously in a function using Handler with a delay. The important thing is that the previous task must be canceled before each call s...
Hussein Yaqoobi
Votes: 0
Answers: 1
How to observe Ktor download progress by a Flow
I want to observe the download progress by a Flow,
so I wrote a function like this:
suspend fun downloadFile(file: File, url: String): Flow<Int>{
val client = HttpClient(Android)
...
TangSir
Votes: 0
Answers: 1
Is there a way to know if your coroutine has been canceled from within a suspend function
I'm using a CoroutineWorker but all my business logic is a separate class which I start using a suspend function. I would prefer to keep all the logic in this class but I need to know if the work requ...

ExNatura
Votes: 0
Answers: 3