1 KiB
1 KiB
Source.repeat
Stream a single object repeatedly.
@refSource operators
Signature
@apidocSource.repeat { scala="#repeatT:akka.stream.scaladsl.Source[T,akka.NotUsed]" java="#repeat(T)" }
Description
This source emits a single element repeatedly. It never completes, if you want the stream to be finite you will need to limit it by combining with another operator
See also:
- @ref:
singleStream a single object once. - @ref:
tickA periodical repetition of an arbitrary object. - @ref:
cycleStream iterator in cycled manner.
Example
This example prints the first 4 elements emitted by Source.repeat.
Reactive Streams semantics
@@@div { .callout }
emits the same value repeatedly when there is demand
completes never
@@@