iterator

operator fun <T> Publisher<T>.iterator(): ChannelIterator<T>

Deprecated: This iteration operator for for (x in source) { ... } loop is deprecated, because it leaves code vulnerable to leaving unclosed subscriptions on exception. Use source.consumeEach { x -&gt; ... }.

Subscribes to this Publisher and returns an iterator to receive elements emitted by it.

This is a shortcut for open().iterator(). See openSubscription if you need an ability to manually unsubscribe from the observable.