cycle

Stream iterator in cycled manner.

Source operators

Signature

def cycle[T](f: () ⇒ Iterator[T]): Source[T, NotUsed]

Description

Stream iterator in cycled manner. Internally new iterator is being created to cycle the one provided via argument meaning when original iterator runs out of elements process will start all over again from the beginning of the iterator provided by the evaluation of provided parameter. If method argument provides empty iterator stream will be terminated with exception.

emits the next value returned from cycled iterator

completes never

Found an error in this documentation? The source code for this page can be found here. Please feel free to edit and contribute a pull request.