Skip to content

Commit

Permalink
Revert "feat: close items after collection in CloningFlow"
Browse files Browse the repository at this point in the history
This reverts commit 4f5f960.
  • Loading branch information
silenium-dev committed Aug 10, 2024
1 parent 4f5f960 commit 706a2ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/kotlin/dev/silenium/libs/flows/impl/CloningFlow.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ class CloningFlow<T : Reference<T>>(private val wrapped: Flow<T>? = null) : Flow
suspend fun publish(value: T): Unit = publishLock.withReentrantLock {
coroutineScope {
collectors.map { (_, collector) ->
value.clone().getOrThrow().use { item ->
launch { collector.emit(item) }
val item = value.clone().getOrThrow()
launch {
collector.emit(item)
}
}.joinAll()
}
Expand Down

0 comments on commit 706a2ab

Please sign in to comment.