portals
portals copied to clipboard
Join and Split method for the FlowBuilder
The FlowBuilder
is currently missing a method for joining two flows and splitting a flow.
The split method could have a signature, implemented somewhat like this:
def split[CCU](p1: PartialFunction[CU, Boolean], p2: PartialFunction[CU, Boolean]): FlowBuilder[T, U, CU, CCU =
(this.filter(x => p1.lift(x).getOrElse(false)), this.filter(x =>p2.lift(x).getOrElse(false))
The join should have a signature like this, which joins the two flows on the key of the flows (note that the key should be set in a separate call to the flow builder by the user):
def join(other: FlowBuilder[T, U, _, CU): FlowBuilder[T, U, CU, CU] =
???