Skip to content

Commit a992b33

Browse files
committed
SdkDispatchers
1 parent bc91650 commit a992b33

File tree

1 file changed

+3
-4
lines changed
  • runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/io

1 file changed

+3
-4
lines changed

runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/io/SdkSource.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ package aws.smithy.kotlin.runtime.io
77

88
import aws.smithy.kotlin.runtime.InternalApi
99
import aws.smithy.kotlin.runtime.io.internal.JobChannel
10+
import aws.smithy.kotlin.runtime.io.internal.SdkDispatchers
1011
import kotlinx.coroutines.CoroutineName
1112
import kotlinx.coroutines.CoroutineScope
1213
import kotlinx.coroutines.DelicateCoroutinesApi
13-
import kotlinx.coroutines.Dispatchers
1414
import kotlinx.coroutines.GlobalScope
15-
import kotlinx.coroutines.IO
1615
import kotlinx.coroutines.ensureActive
1716
import kotlinx.coroutines.launch
1817
import 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

Comments
 (0)