+str,htc #16071, #16072 New Stream Tcp and Http API

* StreamTcp and Http extensions now return Flows and Sources that can be materialized later
* Flow can now be completed with another flow to be turned into a runnable flow
This commit is contained in:
Björn Antonsson 2014-11-28 10:41:57 +01:00
parent cac9137aa9
commit 672d4ed091
43 changed files with 1327 additions and 1236 deletions

View file

@ -73,6 +73,12 @@ trait Source[+Out] extends FlowOps[Out] {
*/
def ++[Out2 >: Out](second: Source[Out2]): Source[Out2] = concat(second)
/**
* Add a key that will have a value available after materialization.
* The key can only use other keys if they have been added to the source
* before this key. This also includes the keyed source if applicable.
*/
def withKey(key: Key): Source[Out]
}
object Source {
@ -139,7 +145,7 @@ object Source {
* a [[FlowGraphBuilder]] and returns the `UndefinedSink`.
*/
def apply[T](graph: PartialFlowGraph)(block: FlowGraphBuilder UndefinedSink[T]): Source[T] =
createSourceFromBuilder(new FlowGraphBuilder(graph.graph), block)
createSourceFromBuilder(new FlowGraphBuilder(graph), block)
private def createSourceFromBuilder[T](builder: FlowGraphBuilder, block: FlowGraphBuilder UndefinedSink[T]): Source[T] = {
val out = block(builder)