Skip to content

Commit 5b9c92b

Browse files
committed
Removed redundant GlobalScope invocation
1 parent 3a361dd commit 5b9c92b

File tree

1 file changed

+2
-8
lines changed
  • krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/krpc/client

1 file changed

+2
-8
lines changed

krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/krpc/client/KrpcClient.kt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import kotlinx.coroutines.CancellationException
99
import kotlinx.coroutines.CompletableDeferred
1010
import kotlinx.coroutines.CoroutineName
1111
import kotlinx.coroutines.CoroutineScope
12-
import kotlinx.coroutines.DelicateCoroutinesApi
13-
import kotlinx.coroutines.GlobalScope
1412
import kotlinx.coroutines.InternalCoroutinesApi
1513
import kotlinx.coroutines.SupervisorJob
1614
import kotlinx.coroutines.cancel
@@ -165,12 +163,8 @@ public abstract class KrpcClient : RpcClient, KrpcEndpoint {
165163
sendCancellation(CancellationType.ENDPOINT, null, null, closeTransportAfterSending = true)
166164
}
167165

168-
@OptIn(DelicateCoroutinesApi::class)
169-
@Suppress("detekt.GlobalCoroutineUsage")
170-
GlobalScope.launch(CoroutineName("client-request-channels-closing")) {
171-
requestChannels.values.forEach { it.close(CancellationException("Client cancelled")) }
172-
requestChannels.clear()
173-
}
166+
requestChannels.values.forEach { it.close(CancellationException("Client cancelled")) }
167+
requestChannels.clear()
174168
}
175169

176170
CoroutineScope(context)

0 commit comments

Comments
 (0)