File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
kotlinx-coroutines-core/common/src/flow Expand file tree Collapse file tree 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.*
6868 * the `onBufferOverflow` parameter, which is equal to one of the entries of the [BufferOverflow] enum. When a strategy other
6969 * than [SUSPENDED][BufferOverflow.SUSPEND] is configured, emissions to the shared flow never suspend.
7070 *
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+ *
7180 * ### SharedFlow vs BroadcastChannel
7281 *
7382 * Conceptually shared flow is similar to [BroadcastChannel][BroadcastChannel]
You can’t perform that action at this time.
0 commit comments