Cleanup, improvements, simplicification, scaladoc and javadoc of SourceWithContext and FlowWithContext

This commit is contained in:
Johannes Rudolph 2019-01-15 16:53:02 +01:00 committed by Raymond Roestenburg
parent d76d259408
commit a2c811d75a
8 changed files with 560 additions and 226 deletions

View file

@ -4,6 +4,7 @@
package akka.stream
import akka.annotation.InternalApi
import akka.stream.impl.TraversalBuilder
import scala.annotation.unchecked.uncheckedVariance
@ -68,3 +69,16 @@ trait Graph[+S <: Shape, +M] {
*/
def addAttributes(attr: Attributes): Graph[S, M] = withAttributes(traversalBuilder.attributes and attr)
}
/**
* INTERNAL API
*
* Allows creating additional API on top of an existing Graph by extending from this class and
* accessing the delegate
*/
@InternalApi
private[stream] abstract class GraphDelegate[+S <: Shape, +Mat](delegate: Graph[S, Mat]) extends Graph[S, Mat] {
final override def shape: S = delegate.shape
final override private[stream] def traversalBuilder: TraversalBuilder = delegate.traversalBuilder
final override def withAttributes(attr: Attributes): Graph[S, Mat] = delegate.withAttributes(attr)
}