I found a code from Ktor has ```(dispatcher as Clo...
# coroutines
i
I found a code from Ktor has
Copy code
(dispatcher as Closeable).close()
inside of
Copy code
GlobalScope.launch(super.coroutineContext, start = CoroutineStart.ATOMIC)
Intellij IDEA reported it as inappropriate blocking method calls. How I can fix it?
z
Probably just suppress the warning. That check is often a false positive, it catches any function calls that have a checked
IOException
and isn’t very smart about determining which dispatcher is actually being used.
i
oh okay, i was not too sure
g
This is indeed potentially blocking call, so it depends on dispatcher