@@ -7,12 +7,11 @@ package aws.smithy.kotlin.runtime.io
77
88import aws.smithy.kotlin.runtime.InternalApi
99import aws.smithy.kotlin.runtime.io.internal.JobChannel
10+ import aws.smithy.kotlin.runtime.io.internal.SdkDispatchers
1011import kotlinx.coroutines.CoroutineName
1112import kotlinx.coroutines.CoroutineScope
1213import kotlinx.coroutines.DelicateCoroutinesApi
13- import kotlinx.coroutines.Dispatchers
1414import kotlinx.coroutines.GlobalScope
15- import kotlinx.coroutines.IO
1615import kotlinx.coroutines.ensureActive
1716import kotlinx.coroutines.launch
1817import kotlinx.coroutines.withContext
@@ -52,7 +51,7 @@ public interface SdkSource : Closeable {
5251 * Consume the [SdkSource] and pull the entire contents into memory as a [ByteArray].
5352 */
5453@InternalApi
55- public suspend fun SdkSource.readToByteArray (): ByteArray = withContext(Dispatchers .IO ) {
54+ public suspend fun SdkSource.readToByteArray (): ByteArray = withContext(SdkDispatchers .IO ) {
5655 use { it.buffer().readByteArray() }
5756}
5857
@@ -68,7 +67,7 @@ public fun SdkSource.toSdkByteReadChannel(coroutineScope: CoroutineScope? = null
6867 val source = this
6968 val ch = JobChannel ()
7069 val scope = coroutineScope ? : GlobalScope
71- val job = scope.launch(Dispatchers .IO + CoroutineName (" sdk-source-reader" )) {
70+ val job = scope.launch(SdkDispatchers .IO + CoroutineName (" sdk-source-reader" )) {
7271 val buffer = SdkBuffer ()
7372 val result = runCatching {
7473 source.use {
0 commit comments