Skip to content

Commit 61cafea

Browse files
committed
Warning about future fail-fast in consumeEach is added to the guide
1 parent 9fe5f46 commit 61cafea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

reactive/coroutines-guide-reactive.md

+6
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ We have two of them in this code and that is why we see "Begin" printed twice.
216216
In Rx lingo this is called a _cold_ publisher. Many standard Rx operators produce cold streams, too. We can iterate
217217
over them from a coroutine, and every subscription produces the same stream of elements.
218218

219+
**WARNING**: It is planned that in the future a second invocation of `consumeEach` method
220+
on an channel that is already being consumed is going to fail fast, that is
221+
immediately throw an `IllegalStateException`.
222+
See [this issue](https://github.com/Kotlin/kotlinx.coroutines/issues/167)
223+
for details.
224+
219225
> Note, that we can replicate the same behaviour that we saw with channels by using Rx
220226
[publish](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html#publish())
221227
operator and [connect](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/flowables/ConnectableFlowable.html#connect())

0 commit comments

Comments
 (0)