+str #17145 add new Flow.wrap overload to create flow from sink and source
This commit is contained in:
parent
d67b5823e6
commit
a58859c77c
1 changed files with 5 additions and 0 deletions
|
|
@ -300,6 +300,11 @@ object Flow extends FlowApply {
|
|||
*/
|
||||
def wrap[I, O, M](g: Graph[FlowShape[I, O], M]): Flow[I, O, M] = new Flow(g.module)
|
||||
|
||||
/**
|
||||
* Helper to create `Flow` from a pair of sink and source.
|
||||
*/
|
||||
def wrap[I, O, M1, M2, M](sink: Sink[I, M1], source: Source[O, M2])(f: (M1, M2) ⇒ M): Flow[I, O, M] =
|
||||
Flow(sink, source)(f) { implicit b ⇒ (in, out) ⇒ (in.inlet, out.outlet) }
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue