Medium Backpressure
Buffer Elements
Create a Flux emitting 1 through 12 and use buffer(4) to collect elements in batches of 4. Subscribe and print each batch.
buffer(n) collects n elements into a List before emitting the batch downstream.
Expected
[1, 2, 3, 4] [5, 6, 7, 8] [9, 10, 11, 12]
Main.kt