File tree 1 file changed +9
-0
lines changed
kotlinx-coroutines-core/common/src/flow
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,15 @@ import kotlin.native.concurrent.*
68
68
* the `onBufferOverflow` parameter, which is equal to one of the entries of the [BufferOverflow] enum. When a strategy other
69
69
* than [SUSPENDED][BufferOverflow.SUSPEND] is configured, emissions to the shared flow never suspend.
70
70
*
71
+ * ### Unbuffered shared flow
72
+ *
73
+ * A default implementation of a shared flow that is created with `MutableSharedFlow()` constructor function
74
+ * without parameters has no replay cache nor additional buffer.
75
+ * [emit][MutableSharedFlow.emit] call to such a shared flow suspends until all subscribers receive the emitted value
76
+ * and returns immediately if there are no subscribers.
77
+ * Thus, [tryEmit][MutableSharedFlow.tryEmit] call succeeds and returns `true` only if
78
+ * there are no subscribers (in which case the emitted value is immediately lost).
79
+ *
71
80
* ### SharedFlow vs BroadcastChannel
72
81
*
73
82
* Conceptually shared flow is similar to [BroadcastChannel][BroadcastChannel]
You can’t perform that action at this time.
0 commit comments