portals icon indicating copy to clipboard operation
portals copied to clipboard

Join and Split method for the FlowBuilder

Open jspenger opened this issue 1 year ago • 0 comments

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] =
  ???

jspenger avatar Jul 14 '23 22:07 jspenger