File tree Expand file tree Collapse file tree 4 files changed +1
-6
lines changed
integration/kotlinx-coroutines-jdk8/src/stream
kotlinx-coroutines-core/common/src/flow Expand file tree Collapse file tree 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)
1919private class StreamFlow <T >(private val stream : Stream <T >) : Flow<T> {
2020 private val consumed = atomic(false )
2121
22- @InternalCoroutinesApi
2322 override suspend fun collect (collector : FlowCollector <T >) {
2423 if (! consumed.compareAndSet(false , true )) error(" Stream.consumeAsFlow can be collected only once" )
2524 try {
Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ import kotlin.coroutines.*
172172 *
173173 * **The `Flow` interface is not stable for inheritance in 3rd party libraries**, as new methods
174174 * 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] .
176176 */
177177public interface Flow <out T > {
178178 /* *
@@ -184,7 +184,6 @@ public interface Flow<out T> {
184184 * should be used. Such limitation ensures that the context preservation property is not violated and prevents most
185185 * of the developer mistakes related to concurrency, inconsistent flow dispatchers and cancellation.
186186 */
187- @InternalCoroutinesApi
188187 public suspend fun collect (collector : FlowCollector <T >)
189188}
190189
@@ -214,7 +213,6 @@ public interface Flow<out T> {
214213@FlowPreview
215214public abstract class AbstractFlow <T > : Flow <T >, CancellableFlow <T > {
216215
217- @InternalCoroutinesApi
218216 public final override suspend fun collect (collector : FlowCollector <T >) {
219217 val safeCollector = SafeCollector (collector, coroutineContext)
220218 try {
Original file line number Diff line number Diff line change @@ -140,7 +140,6 @@ public interface SharedFlow<out T> : Flow<T> {
140140 *
141141 * @see [Flow.collect]
142142 */
143- @InternalCoroutinesApi
144143 override suspend fun collect (collector : FlowCollector <T >): Nothing
145144}
146145
Original file line number Diff line number Diff line change @@ -71,7 +71,6 @@ private class DistinctFlowImpl<T>(
7171 @JvmField val keySelector : (T ) -> Any? ,
7272 @JvmField val areEquivalent : (old: Any? , new: Any? ) -> Boolean
7373): Flow<T> {
74- @InternalCoroutinesApi
7574 override suspend fun collect (collector : FlowCollector <T >) {
7675 var previousKey: Any? = NULL
7776 upstream.collect { value ->
You can’t perform that action at this time.
0 commit comments