drop
Drop n
elements and then pass any subsequent element downstream.
Signature
Description
Drop n
elements and then pass any subsequent element downstream.
Example
Given a Source
of numbers we can drop the first 3 elements with the drop
operator:
- Scala
-
source
val fiveInts: Source[Int, NotUsed] = Source(1 to 5) val droppedThreeInts: Source[Int, NotUsed] = fiveInts.drop(3) droppedThreeInts.runForeach(println) // 4 // 5
- Java
Reactive Streams semantics
emits when the specified number of elements has been dropped already
backpressures when the specified number of elements has been dropped and downstream backpressures
completes when upstream completes