• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3  */
4 
5 @file:JvmMultifileClass
6 @file:JvmName("FlowKt")
7 
8 package kotlinx.coroutines.reactive
9 
10 import kotlinx.coroutines.*
11 import kotlinx.coroutines.flow.*
12 import org.reactivestreams.*
13 
14 // Binary compatibility with Spring 5.2 RC
15 /** @suppress */
16 @Deprecated(
17     message = "Replaced in favor of ReactiveFlow extension, please import kotlinx.coroutines.reactive.* instead of kotlinx.coroutines.reactive.FlowKt",
18     level = DeprecationLevel.HIDDEN
19 )
20 @JvmName("asFlow")
asFlowDeprecatednull21 public fun <T : Any> Publisher<T>.asFlowDeprecated(): Flow<T> = asFlow()
22 
23 // Binary compatibility with Spring 5.2 RC
24 /** @suppress */
25 @Deprecated(
26     message = "Replaced in favor of ReactiveFlow extension, please import kotlinx.coroutines.reactive.* instead of kotlinx.coroutines.reactive.FlowKt",
27     level = DeprecationLevel.HIDDEN
28 )
29 @JvmName("asPublisher")
30 public fun <T : Any> Flow<T>.asPublisherDeprecated(): Publisher<T> = asPublisher()
31 
32 /** @suppress */
33 @FlowPreview
34 @Deprecated(
35     message = "batchSize parameter is deprecated, use .buffer() instead to control the backpressure",
36     level = DeprecationLevel.HIDDEN,
37     replaceWith = ReplaceWith("asFlow().buffer(batchSize)", imports = ["kotlinx.coroutines.flow.*"])
38 )
39 public fun <T : Any> Publisher<T>.asFlow(batchSize: Int): Flow<T> = asFlow().buffer(batchSize)
40