Skip to content

Commit

Permalink
~documentation cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
qwwdfsad committed Feb 11, 2020
1 parent 7d7eba6 commit 62e6275
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion kotlinx-coroutines-core/api/kotlinx-coroutines-core.api
Expand Up @@ -987,7 +987,6 @@ public abstract class kotlinx/coroutines/flow/internal/ChannelFlow : kotlinx/cor
public fun collect (Lkotlinx/coroutines/flow/FlowCollector;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
protected abstract fun collectTo (Lkotlinx/coroutines/channels/ProducerScope;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
protected abstract fun create (Lkotlin/coroutines/CoroutineContext;I)Lkotlinx/coroutines/flow/internal/ChannelFlow;
protected final fun getProduceCapacity ()I
public fun produceImpl (Lkotlinx/coroutines/CoroutineScope;)Lkotlinx/coroutines/channels/ReceiveChannel;
public fun toString ()Ljava/lang/String;
public final fun update (Lkotlin/coroutines/CoroutineContext;I)Lkotlinx/coroutines/flow/internal/ChannelFlow;
Expand Down
8 changes: 4 additions & 4 deletions kotlinx-coroutines-core/common/src/flow/Builders.kt
Expand Up @@ -298,8 +298,8 @@ public fun <T> channelFlow(@BuilderInference block: suspend ProducerScope<T>.()
* }
* api.register(callback)
* /*
* * Suspends until either 'onCompleted' from the callback is invoked
* * or flow collector is cancelled (e.g. by 'take(1)' or because a collector's activity was destroyed).
* * Suspends until either 'onCompleted'/'onApiError' from the callback is invoked
* * or flow collector is cancelled (e.g. by 'take(1)' or because a collector's coroutine was cancelled).
* * In both cases, callback will be properly unregistered.
* */
* awaitClose { api.unregister(callback) }
Expand Down Expand Up @@ -342,8 +342,8 @@ private class CallbackFlowBuilder<T>(
throw IllegalStateException(
"""
'awaitClose { yourCallbackOrListener.cancel() }' should be used in the end of callbackFlow block.
Otherwise, a callback/listener may leak in case of cancellation external cancellation (e.g. by 'take(1)' or destroyed activity).
See callbackFlow API documentation for the details.
Otherwise, a callback/listener may leak in case of external cancellation.
See callbackFlow API documentation for the details.
""".trimIndent()
)
}
Expand Down
Expand Up @@ -32,7 +32,7 @@ public abstract class ChannelFlow<T>(
internal val collectToFun: suspend (ProducerScope<T>) -> Unit
get() = { collectTo(it) }

protected val produceCapacity: Int
private val produceCapacity: Int
get() = if (capacity == Channel.OPTIONAL_CHANNEL) Channel.BUFFERED else capacity

public fun update(
Expand Down

0 comments on commit 62e6275

Please sign in to comment.