File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -157,12 +157,19 @@ class KrpcTestServiceBackend : KrpcTestService {
157157 return arg1.count()
158158 }
159159
160+ @OptIn(DelicateCoroutinesApi ::class )
161+ @Suppress(" detekt.GlobalCoroutineUsage" )
160162 override suspend fun incomingStreamSyncCollectMultiple (
161163 arg1 : Flow <String >,
162164 arg2 : Flow <String >,
163165 arg3 : Flow <String >,
164166 ): Int {
165- return arg1.count() + arg2.count() + arg3.count()
167+ // buffer of size 1 may cause lock here without multiple coroutines
168+ return listOf (
169+ GlobalScope .async { arg1.count() },
170+ GlobalScope .async { arg2.count() },
171+ GlobalScope .async { arg3.count() },
172+ ).awaitAll().sum()
166173 }
167174
168175 override fun outgoingStream (): Flow <String > {
You can’t perform that action at this time.
0 commit comments