File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
kotlinx-coroutines-core/common/src/flow Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,10 @@ private suspend fun <T> FlowCollector<T>.emitAllImpl(channel: ReceiveChannel<T>,
5151 * - Flow collectors are cancelled when the original channel is [closed][SendChannel.close] with an exception.
5252 * - Flow collectors complete normally when the original channel is [closed][SendChannel.close] normally.
5353 * - Failure or cancellation of the flow collector does not affect the channel.
54+ * However, if a flow collector gets cancelled after receiving an element from the channel but before starting
55+ * to process it, the element will be lost, and the `onUndeliveredElement` callback of the [Channel],
56+ * if provided on channel construction, will be invoked.
57+ * See [Channel.receive] for details of the effect of the prompt cancellation guarantee on element delivery.
5458 *
5559 * ### Operator fusion
5660 *
@@ -71,7 +75,8 @@ public fun <T> ReceiveChannel<T>.receiveAsFlow(): Flow<T> = ChannelAsFlow(this,
7175 *
7276 * - Flow collector is cancelled when the original channel is [closed][SendChannel.close] with an exception.
7377 * - Flow collector completes normally when the original channel is [closed][SendChannel.close] normally.
74- * - If the flow collector fails with an exception, the source channel is [cancelled][ReceiveChannel.cancel].
78+ * - If the flow collector fails with an exception (for example, by getting cancelled),
79+ * the source channel is [cancelled][ReceiveChannel.cancel].
7580 *
7681 * ### Operator fusion
7782 *
You can’t perform that action at this time.
0 commit comments