#19238 add detach operator and fix Detach stage

This commit is contained in:
Roland Kuhn 2015-12-20 11:25:53 +01:00
parent aadaf15b89
commit b0b03176ae
9 changed files with 133 additions and 2 deletions

View file

@ -1299,6 +1299,20 @@ trait FlowOps[+Out, +Mat] {
via(new Throttle(cost, per, maximumBurst, costCalculation, mode))
}
/**
* Detaches upstream demand from downstream demand without detaching the
* stream rates; in other words acts like a buffer of size 1.
*
* '''Emits when''' upstream emits an element
*
* '''Backpressures when''' downstream backpressures
*
* '''Completes when''' upstream completes
*
* '''Cancels when''' downstream cancels
*/
def detach: Repr[Out] = via(GraphStages.detacher)
/**
* Delays the initial element by the specified duration.
*