The most common partition-case, as divertTo(Mat) #24388
This commit is contained in:
parent
6264f8ea70
commit
e999d03e8b
11 changed files with 174 additions and 1 deletions
|
|
@ -1142,6 +1142,21 @@ class SubSource[+Out, +Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Source
|
|||
def alsoTo(that: Graph[SinkShape[Out], _]): SubSource[Out, Mat] =
|
||||
new SubSource(delegate.alsoTo(that))
|
||||
|
||||
/**
|
||||
* Attaches the given [[Sink]] to this [[Flow]], meaning that elements will be sent to the [[Sink]]
|
||||
* instead of being passed through if the predicate `when` returns `true`.
|
||||
*
|
||||
* '''Emits when''' emits when an element is available from the input and the chosen output has demand
|
||||
*
|
||||
* '''Backpressures when''' the currently chosen output back-pressures
|
||||
*
|
||||
* '''Completes when''' upstream completes and no output is pending
|
||||
*
|
||||
* '''Cancels when''' when all downstreams cancel
|
||||
*/
|
||||
def divertTo(that: Graph[SinkShape[Out], _], when: function.Predicate[Out]): SubSource[Out, Mat] =
|
||||
new SubSource(delegate.divertTo(that, when.test))
|
||||
|
||||
/**
|
||||
* Merge the given [[Source]] to this [[Flow]], taking elements as they arrive from input streams,
|
||||
* picking randomly when several elements ready.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue