Skip to content

Commit 6bac4d1

Browse files
committed
Rx.createEmitFlow() now creates a flow with unlimited buffer, same as RxJava's PublishSubject
1 parent 4b41ebf commit 6bac4d1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# DurianRx releases
22

33
## [Unreleased]
4+
### Fixed
5+
- `Rx.createEmitFlow()` now creates a flow with unlimited buffer, same as RxJava's `PublishSubject`.
46

57
## [5.0.1] - 2025-01-26
68
### Changed

src/main/java/com/diffplug/common/rx/Rx.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import kotlinx.coroutines.Deferred
3636
import kotlinx.coroutines.Job
3737
import kotlinx.coroutines.asCoroutineDispatcher
3838
import kotlinx.coroutines.channels.BufferOverflow
39+
import kotlinx.coroutines.channels.Channel
3940
import kotlinx.coroutines.flow.Flow
4041
import kotlinx.coroutines.flow.MutableSharedFlow
4142
import kotlinx.coroutines.flow.merge
@@ -102,7 +103,8 @@ import kotlinx.coroutines.flow.merge
102103
object Rx {
103104
@JvmStatic
104105
fun <T> createEmitFlow() =
105-
MutableSharedFlow<T>(replay = 0, extraBufferCapacity = 1, BufferOverflow.SUSPEND)
106+
MutableSharedFlow<T>(
107+
replay = 0, extraBufferCapacity = Channel.UNLIMITED, BufferOverflow.SUSPEND)
106108

107109
@JvmStatic
108110
fun <T> emit(flow: MutableSharedFlow<T>, value: T) {

0 commit comments

Comments
 (0)