479 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
2
answers
241
views
Argument type mismatch: actual type is 'SuspendFunction1<String, Function0<Int>>', but 'SuspendFunction0<Function0<Int>>' was expected
For example I have the following code (see for example at https://pl.kotl.in/-1hmKnK8i):
val a = suspend {b: String -> {0}}
On this code I then get the following error:
Argument type mismatch: ...
0
votes
0
answers
45
views
Kotlin flow suspends in onEach for too long
I have a question about why my onEach intermediate operator suspends for so long? I have a web socket that emits a flow of events.
localJob = coroutineScope.async(Dispatchers.IO + ...
0
votes
1
answer
60
views
Code after suspended function call not executed in Kotlin coroutine
I'm using Kotlin coroutines to manage a TLS socket connection. In my minimal version of sendMessageToServerTest, I call connectTest() when the socket is not connected, then log the result. However, ...
0
votes
0
answers
228
views
Installshield installation is suspended (blocked) during 2-3 minutes
I am under Windows 11 - 24H2.
I wrote an Installshield installation. I'm having problems with the installation, or at least slowness during the installation.
When I start the installation from Windows ...
0
votes
0
answers
59
views
Kotlin Flow does not work as expected if the user does not use the app
I have a food delivery KMM app, and for fetching the restaurants lists, I am not sure if I should use Flow or suspend methods.
I use KMM with Firestore, and my biggest concern is having the data up to ...
1
vote
0
answers
150
views
How to unit test the suspend function to meet branch coverage using mockk
I wrote a Kotlin code and I want to write unit tests for it. But I found that the unit test code I wrote still cannot cover 100% branch coverage. What should I do it?
kotlin code:
class MyRepository @...
0
votes
0
answers
594
views
Spring @Retryable is not working on Kotlin suspend fun
I'm trying to add retry logic on my @Service method and it's not working if the method is suspend. (It's Kotlin/Gradle/Spring project).
Below is the working method (just for test):
@Retryable(...
-1
votes
1
answer
136
views
Function overloading between suspend and non-suspend function is not possible in Kotlin [closed]
I want to provide synchronous version of my asynchronous function, but I can't over load, the function have structure like this. Who can explain, why I can't, and is there any other way to overload ...
-2
votes
1
answer
66
views
Jetpack Compose Framework - Android - Kotlin - In a Textfield, why isn't 'query' value being changed once my suspend coroutine is completed?
Short: In my Textfield, why isn't "query" value being cleared once my coroutine is completed?
In my Textfield composable, I am testing a "query" value being passed through a ...
1
vote
0
answers
46
views
Isn't stacking suspend'able functions a performance killer?
While diving into Android/Kotlin development, I learned that the suspend keyword transforms the function into a state machine that can be removed from its executing thread, put on hold, and resumed at ...
0
votes
1
answer
211
views
Understanding the idea and usecases of suspendCoroutine
I am reading Kotlin Coroutines Deep Dive by Marcin Moskala, and I have a problem understanding suspendCoroutine function.
AFAIK, suspendCoroutine is a low-level API that helps you possess the ...
0
votes
1
answer
199
views
How to call a suspend function of a kotlin class from a java class without blocking the underlying thread
I have a following kotlin class
class KotlinClass() {
suspend fun executeSuspend(): ResultClass {
.....
}
}
I want to call this suspend function from a Java class.
public class JavaClass {
...
1
vote
0
answers
59
views
The result of Kotlin suspend fun cannot be received from @AfterReturning in spring boot 3.2.x version
After calling the suspend func, we are post-processing the response (ex logging,...) through @AfterReturning.
Until spring boot version 3.1.12, we were able to receive and process returning value as ...
0
votes
0
answers
166
views
Is there a way by which PCIe devices can tell the host/OS that they support D3 power management state or not
Does ACPI have a method by which individual devices like PCIe devices etc can let the BIOS/OS know that it does or does not support D3 state (or any low power state for that matter)?
Tried searching ...
0
votes
1
answer
191
views
How can i create a save/delete button in Jetpack compose?
im new to Jetpack and the whole Android development.
My issue is that I have a @Composable like this:
@Composable
private fun RecipeDetailsBody(
recipe: SmallResult,
pressOnBack: () -> Unit,
...