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 {
157
157
return arg1.count()
158
158
}
159
159
160
+ @OptIn(DelicateCoroutinesApi ::class )
161
+ @Suppress(" detekt.GlobalCoroutineUsage" )
160
162
override suspend fun incomingStreamSyncCollectMultiple (
161
163
arg1 : Flow <String >,
162
164
arg2 : Flow <String >,
163
165
arg3 : Flow <String >,
164
166
): 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()
166
173
}
167
174
168
175
override fun outgoingStream (): Flow <String > {
You can’t perform that action at this time.
0 commit comments