• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package kotlinx.coroutines.reactive
2 
3 import kotlinx.coroutines.channels.*
4 import org.reactivestreams.*
5 import kotlin.coroutines.*
6 
7 /** @suppress */
8 @Deprecated(message = "Deprecated in the favour of consumeAsFlow()",
9     level = DeprecationLevel.HIDDEN, // Error in 1.4, HIDDEN in 1.6.0
10     replaceWith = ReplaceWith("this.consumeAsFlow().asPublisher(context)", imports = ["kotlinx.coroutines.flow.consumeAsFlow"]))
<lambda>null11 public fun <T> ReceiveChannel<T>.asPublisher(context: CoroutineContext = EmptyCoroutineContext): Publisher<T> = publish(context) {
12     for (t in this@asPublisher)
13         send(t)
14 }
15