File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
core/src/commonMain/kotlin/kotlinx/rpc
krpc-client/src/commonMain/kotlin/kotlinx/rpc/krpc/client
krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/internal Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -44,13 +44,13 @@ public interface RpcClient : CoroutineScope {
4444 public fun <T > callAsync (serviceScope : CoroutineScope , call : RpcCall ): Deferred <T >
4545
4646 /* *
47- * This method is used by generated clients to perform a call to the server.
47+ * This method is used by generated clients to perform a call to the server
48+ * that returns a streaming flow.
4849 *
4950 * @param T type of the result
50- * @param serviceScope service's coroutine scope
5151 * @param call an object that contains all required information about the called method,
5252 * that is needed to route it properly to the server.
53- * @return actual result of the call, for example, data from the server
53+ * @return the actual result of the call, for example, data from the server
5454 */
5555 public fun <T > callServerStreaming (call : RpcCall ): Flow <T > {
5656 error(" Non-suspending server streaming is not supported by this client" )
Original file line number Diff line number Diff line change @@ -316,6 +316,7 @@ public abstract class KrpcClient(
316316
317317 private val nonSuspendingSerialFormat = config.serialFormatInitializer.build()
318318
319+ @Suppress(" detekt.CyclomaticComplexMethod" )
319320 override fun <T > callServerStreaming (call : RpcCall ): Flow <T > {
320321 return flow {
321322 awaitHandshakeCompletion()
@@ -363,8 +364,8 @@ public abstract class KrpcClient(
363364
364365 is KrpcCallMessage .CallSuccess , is KrpcCallMessage .StreamMessage -> {
365366 val value = runCatching {
366- val serializerResult =
367- nonSuspendingSerialFormat.serializersModule .rpcSerializerForType(callable.returnType)
367+ val serializerResult = nonSuspendingSerialFormat.serializersModule
368+ .rpcSerializerForType(callable.returnType)
368369
369370 decodeMessageData(nonSuspendingSerialFormat, serializerResult, message)
370371 }
Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ internal class KrpcServerService<@Rpc T : Any>(
160160 .contains(KrpcPluginKey .NON_SUSPENDING_SERVER_FLOW_MARKER )
161161
162162 if (callable.isNonSuspendFunction && ! markedNonSuspending) {
163+ @Suppress(" detekt.MaxLineLength" )
163164 error(
164165 " Server flow returned from non-suspend function but marked so by a client: ${descriptor.fqName} ::$callableName ." +
165166 " Probable cause is outdated client version, that does not support non-suspending flows, " +
You can’t perform that action at this time.
0 commit comments