We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2098080 commit 12355ceCopy full SHA for 12355ce
src/commonMain/kotlin/com/hoc081098/flowext/race.kt
@@ -25,7 +25,6 @@
25
package com.hoc081098.flowext
26
27
import kotlinx.coroutines.ExperimentalCoroutinesApi
28
-import kotlinx.coroutines.channels.ChannelResult
29
import kotlinx.coroutines.channels.onFailure
30
import kotlinx.coroutines.channels.onSuccess
31
import kotlinx.coroutines.channels.produce
@@ -100,7 +99,7 @@ public fun <T> race(flows: Iterable<Flow<T>>): Flow<T> = flow {
100
99
.singleOrNull()
101
?.let { return@coroutineScope emitAll(it) }
102
103
- val (winnerIndex, winnerResult) = select<Pair<Int, ChannelResult<T>>> {
+ val (winnerIndex, winnerResult) = select {
104
channels.forEachIndexed { index, channel ->
105
channel.onReceiveCatching {
106
index to it
0 commit comments