Skip to content

Commit

Permalink
~ Don't mark broadcast as obsolete yet
Browse files Browse the repository at this point in the history
There is no replacement and it would just makes life harder for people.
  • Loading branch information
elizarov committed Mar 16, 2020
1 parent 9ef76cc commit 59b4067
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions kotlinx-coroutines-core/common/src/channels/Broadcast.kt
Expand Up @@ -39,7 +39,6 @@ import kotlin.native.concurrent.*
*
* @param start coroutine start option. The default value is [CoroutineStart.LAZY].
*/
//@ObsoleteCoroutinesApi // since version 1.4.0
fun <E> ReceiveChannel<E>.broadcast(
capacity: Int = 1,
start: CoroutineStart = CoroutineStart.LAZY
Expand Down Expand Up @@ -93,20 +92,19 @@ fun <E> ReceiveChannel<E>.broadcast(
* It causes failure of the `send` operation in broadcast coroutine and would not cancel it if the
* coroutine is doing something else.
*
* ### Obsolete
* ### Future replacement
*
* This function has an inappropriate result type of [BroadcastChannel] which provides
* [send][BroadcastChannel.send] and [close][BroadcastChannel.close] operations that interfere with
* the broadcasting coroutine in hard-to-specify ways. It will be replaced with
* sharing operators on [Flow][kotlinx.coroutines.flow.Flow].
* sharing operators on [Flow][kotlinx.coroutines.flow.Flow] in the future.
*
* @param context additional to [CoroutineScope.coroutineContext] context of the coroutine.
* @param capacity capacity of the channel's buffer (1 by default).
* @param start coroutine start option. The default value is [CoroutineStart.LAZY].
* @param onCompletion optional completion handler for the producer coroutine (see [Job.invokeOnCompletion]).
* @param block the coroutine code.
*/
@ObsoleteCoroutinesApi // since version 1.4.0
public fun <E> CoroutineScope.broadcast(
context: CoroutineContext = EmptyCoroutineContext,
capacity: Int = 1,
Expand Down

0 comments on commit 59b4067

Please sign in to comment.