This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.stream._ | |
import akka.stream.stage.{GraphStage, GraphStageLogic, InHandler, OutHandler} | |
import scala.collection.immutable | |
final case class GroupedWithList[T](n: Int) extends GraphStage[FlowShape[T, immutable.Seq[T]]] { | |
require(n > 0, "n must be greater than 0") | |
val in = Inlet[T]("Grouped.in") | |
val out = Outlet[immutable.Seq[T]]("Grouped.out") |