I have a Room database that returns a Flow of objects. When I insert a new item into the database, the Flow's collect function only triggers if the insert was p
I use the KMongo tool How we can mock a Coroutine Database? How can we mock our database in a koin module? Is there a way to do this? Thanks for guiding me Meth
I need to use coroutines inside a custom view. After watching this talk, I believe my best option is to use lifecycleScope as the coroutine scope, so that it wi
I'm trying to query Room database(action 1) and then based on the returned results perform another action on the same table. however I noticed that every time I
I'm using Coroutines for dealing with async jobs: viewModelScope.launch { val userResponse = getUsers() //suspendable function } What I want to do is stop
How to provide scope or how to call suspend function from Service Android? Usually, activity or viewmodel provides us the scope, from where we can launch suspen
I have an issue regarding kotlin flow merging. See below fun. suspend fun method(filter: String): Flow<List<Model>> { // Search. val models: List&l
I also made another class that implements runnable to make a new thread still it's now working, Also tried with Aynctask. At last, I made a view model but still
I want my extension function to have a couple of receivers. For example, I want function handle to be able to call methods of both CoroutineScope and Iterable i
Recently I saw this - Most data sources already provide main-safe APIs like the suspend method calls provided by Room or Retrofit. Your repository can take adva
I'm trying to follow the official guidelines to migrate from LiveData to Flow/StateFlow with Compose, as per these articles: A safer way to collect flows from A
Kotlin code runBlocking { flow { for (i in 0..4) { println("Emit $i") emit(i) }} .onEach { if (it%2 == 0) delay(20
When browsing through Kotlin source code, I found that in some places NotImplementedError is thrown: public suspend inline val coroutineContext: CoroutineContex
I am currently trying to leverage kotlin coroutines more. But I face a problem: when using moshi or okhttp inside these coroutines I get a warning: "inappropri
It shows only I/Process: Sending signal. PID: xxxxx SIG: 9 I have tried to enable debug mode System.setProperty(DEBUG_PROPERTY_NAME, DEBUG_PROPERTY_VALUE_ON) b
MutableStateFlow doesn't notify collectors if the updated value equals the old value (source). I've found a workaround for this, but it doesn't scale well for c
I am receiving back this kotlinx.coroutines.channels.ClosedReceiveChannelException upon about 50% of my api calls to a post url through Ktor HttpClient. Our cod
How is it possible to debug Kotlin code when stepping into or out of a "suspend" function? (see example below). fun mainFunction() = runBlocking { println
Typical use for AsyncTask: I want to run a task in another thread and after that task is done, I want to perform some operation in my UI thread, namely hiding a
I want to implement timer using Kotlin coroutines, something similar to this implemented with RxJava: Flowable.interval(0, 5, TimeUnit.SECONDS)