File tree 4 files changed +1
-6
lines changed
integration/kotlinx-coroutines-jdk8/src/stream
kotlinx-coroutines-core/common/src/flow
4 files changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ public fun <T> Stream<T>.consumeAsFlow(): Flow<T> = StreamFlow(this)
19
19
private class StreamFlow <T >(private val stream : Stream <T >) : Flow<T> {
20
20
private val consumed = atomic(false )
21
21
22
- @InternalCoroutinesApi
23
22
override suspend fun collect (collector : FlowCollector <T >) {
24
23
if (! consumed.compareAndSet(false , true )) error(" Stream.consumeAsFlow can be collected only once" )
25
24
try {
Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ import kotlin.coroutines.*
172
172
*
173
173
* **The `Flow` interface is not stable for inheritance in 3rd party libraries**, as new methods
174
174
* might be added to this interface in the future, but is stable for use.
175
- * Use the `flow { ... }` builder function to create an implementation.
175
+ * Use the `flow { ... }` builder function to create an implementation, or extend [AbstractFlow] .
176
176
*/
177
177
public interface Flow <out T > {
178
178
/* *
@@ -184,7 +184,6 @@ public interface Flow<out T> {
184
184
* should be used. Such limitation ensures that the context preservation property is not violated and prevents most
185
185
* of the developer mistakes related to concurrency, inconsistent flow dispatchers and cancellation.
186
186
*/
187
- @InternalCoroutinesApi
188
187
public suspend fun collect (collector : FlowCollector <T >)
189
188
}
190
189
@@ -214,7 +213,6 @@ public interface Flow<out T> {
214
213
@FlowPreview
215
214
public abstract class AbstractFlow <T > : Flow <T >, CancellableFlow <T > {
216
215
217
- @InternalCoroutinesApi
218
216
public final override suspend fun collect (collector : FlowCollector <T >) {
219
217
val safeCollector = SafeCollector (collector, coroutineContext)
220
218
try {
Original file line number Diff line number Diff line change @@ -140,7 +140,6 @@ public interface SharedFlow<out T> : Flow<T> {
140
140
*
141
141
* @see [Flow.collect]
142
142
*/
143
- @InternalCoroutinesApi
144
143
override suspend fun collect (collector : FlowCollector <T >): Nothing
145
144
}
146
145
Original file line number Diff line number Diff line change @@ -71,7 +71,6 @@ private class DistinctFlowImpl<T>(
71
71
@JvmField val keySelector : (T ) -> Any? ,
72
72
@JvmField val areEquivalent : (old: Any? , new: Any? ) -> Boolean
73
73
): Flow<T> {
74
- @InternalCoroutinesApi
75
74
override suspend fun collect (collector : FlowCollector <T >) {
76
75
var previousKey: Any? = NULL
77
76
upstream.collect { value ->
You can’t perform that action at this time.
0 commit comments