From 03ee474f49e897c8bd87b65f73232d9e7ea24f27 Mon Sep 17 00:00:00 2001 From: kerr Date: Mon, 21 Feb 2022 21:08:36 +0800 Subject: [PATCH] =str Add scaladoc to Graph (#31141) --- akka-stream/src/main/scala/akka/stream/Graph.scala | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/akka-stream/src/main/scala/akka/stream/Graph.scala b/akka-stream/src/main/scala/akka/stream/Graph.scala index 0bbd9fab5e..3220ba0cdc 100644 --- a/akka-stream/src/main/scala/akka/stream/Graph.scala +++ b/akka-stream/src/main/scala/akka/stream/Graph.scala @@ -21,6 +21,7 @@ trait Graph[+S <: Shape, +M] { * Type-level accessor for the shape parameter of this graph. */ type Shape = S @uncheckedVariance + /** * The shape of a graph is all that is externally visible: its inlets and outlets. */ @@ -33,8 +34,17 @@ trait Graph[+S <: Shape, +M] { */ private[stream] def traversalBuilder: TraversalBuilder + /** + * Replace the attributes of this [[Flow]] with the given ones. If this Flow is a composite + * of multiple graphs, new attributes on the composite will be less specific than attributes + * set directly on the individual graphs of the composite. + */ def withAttributes(attr: Attributes): Graph[S, M] + /** + * Specifies the name of the Graph. + * If the name is null or empty the name is ignored, i.e. [[#none]] is returned. + */ def named(name: String): Graph[S, M] = addAttributes(Attributes.name(name)) /** @@ -47,7 +57,7 @@ trait Graph[+S <: Shape, +M] { * * @param dispatcher Run the graph on this dispatcher */ - def async(dispatcher: String) = + def async(dispatcher: String): Graph[S, M] = addAttributes(Attributes.asyncBoundary and ActorAttributes.dispatcher(dispatcher)) /** @@ -56,7 +66,7 @@ trait Graph[+S <: Shape, +M] { * @param dispatcher Run the graph on this dispatcher * @param inputBufferSize Set the input buffer to this size for the graph */ - def async(dispatcher: String, inputBufferSize: Int) = + def async(dispatcher: String, inputBufferSize: Int): Graph[S, M] = addAttributes( Attributes.asyncBoundary and ActorAttributes.dispatcher(dispatcher) and Attributes.inputBuffer(inputBufferSize, inputBufferSize))