Hey everyone! I'm trying to pass a `Flow<Int>` as ...
# kotlinx-rpc
j
Hey everyone! I'm trying to pass a
Flow<Int>
as a parameter of an RPC but it fails with:
Copy code
Exception in thread "main" kotlinx.serialization.SerializationException: Serializer for subclass 'SafeFlow' is not found in the polymorphic scope of 'Flow'.
Check if class with serial name 'SafeFlow' exists and serializer is registered in a corresponding SerializersModule.
To be registered automatically, class 'SafeFlow' has to be '@Serializable', and the base class 'Flow' has to be sealed and '@Serializable'.
Any idea what I need to do to make it work? It reproduces even with this sample service:
Copy code
@Rpc
interface ExampleService : RemoteService {
    suspend fun multiply(bar: Flow<Int>): Flow<Int>
}
I'm using krpc 0.4.0.
Looks like I need to explicitly add the
@Contextual
annotation to make it work
According to the docs, it shouldn't be necessary
a
Hey! Thank you for the catch, I will take a look and either fix the docs or the bug
Hi! I can not reproduce this in 0.4.0 or current main, can you please provide some more details?