Class RunnableGraph<Mat>

  • All Implemented Interfaces:
    java.io.Serializable, Graph<ClosedShape,​Mat>, scala.Equals, scala.Product

    public final class RunnableGraph<Mat>
    extends java.lang.Object
    implements Graph<ClosedShape,​Mat>, scala.Product, java.io.Serializable
    See Also:
    Serialized Form
    • Constructor Detail

      • RunnableGraph

        public RunnableGraph​(org.apache.pekko.stream.impl.TraversalBuilder traversalBuilder)
    • Method Detail

      • fromGraph

        public static <Mat> RunnableGraph<Mat> fromGraph​(Graph<ClosedShape,​Mat> g)
        A graph with a closed shape is logically a runnable graph, this method makes it so also in type.
      • apply

        public static <Mat> RunnableGraph<Mat> apply​(org.apache.pekko.stream.impl.TraversalBuilder traversalBuilder)
        Flow with attached input and output, can be executed.
      • unapply

        public static <Mat> scala.Option<org.apache.pekko.stream.impl.TraversalBuilder> unapply​(RunnableGraph<Mat> x$0)
      • traversalBuilder

        public org.apache.pekko.stream.impl.TraversalBuilder traversalBuilder()
        Description copied from interface: Graph
        INTERNAL API.

        Every materializable element must be backed by a stream layout module

        Specified by:
        traversalBuilder in interface Graph<ClosedShape,​Mat>
      • shape

        public ClosedShape$ shape()
        Description copied from interface: Graph
        The shape of a graph is all that is externally visible: its inlets and outlets.
        Specified by:
        shape in interface Graph<ClosedShape,​Mat>
      • mapMaterializedValue

        public <Mat2> RunnableGraph<Mat2> mapMaterializedValue​(scala.Function1<Mat,​Mat2> f)
        Transform only the materialized value of this RunnableGraph, leaving all other properties as they were.
      • run

        public Mat run​(Materializer materializer)
        Run this flow and return the materialized instance from the flow.

        Note that the ActorSystem can be used as the implicit materializer parameter to use the pekko.stream.SystemMaterializer for running the stream.

      • addAttributes

        public RunnableGraph<Mat> addAttributes​(Attributes attr)
        Description copied from interface: Graph
        Add the given attributes to this Graph. If the specific attribute was already present on this graph this means the added attribute will be more specific than the existing one. If this Source 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.
        Specified by:
        addAttributes in interface Graph<ClosedShape,​Mat>
      • withAttributes

        public RunnableGraph<Mat> withAttributes​(Attributes attr)
        Description copied from interface: Graph
        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.
        Specified by:
        withAttributes in interface Graph<ClosedShape,​Mat>
      • named

        public RunnableGraph<Mat> named​(java.lang.String name)
        Description copied from interface: Graph
        Specifies the name of the Graph. If the name is null or empty the name is ignored, i.e. Attributes.none is returned.
        Specified by:
        named in interface Graph<ClosedShape,​Mat>
      • async

        public RunnableGraph<Mat> async​(java.lang.String dispatcher)
        Note that an async boundary around a runnable graph does not make sense
        Specified by:
        async in interface Graph<ClosedShape,​Mat>
        Parameters:
        dispatcher - Run the graph on this dispatcher
      • async

        public RunnableGraph<Mat> async​(java.lang.String dispatcher,
                                        int inputBufferSize)
        Note that an async boundary around a runnable graph does not make sense
        Specified by:
        async in interface Graph<ClosedShape,​Mat>
        Parameters:
        dispatcher - Run the graph on this dispatcher
        inputBufferSize - Set the input buffer to this size for the graph
      • asJava

        public RunnableGraph<Mat> asJava()
        Converts this Scala DSL element to it's Java DSL counterpart.
      • copy

        public <Mat> RunnableGraph<Mat> copy​(org.apache.pekko.stream.impl.TraversalBuilder traversalBuilder)
      • copy$default$1

        public <Mat> org.apache.pekko.stream.impl.TraversalBuilder copy$default$1()
      • productPrefix

        public java.lang.String productPrefix()
        Specified by:
        productPrefix in interface scala.Product
      • productArity

        public int productArity()
        Specified by:
        productArity in interface scala.Product
      • productElement

        public java.lang.Object productElement​(int x$1)
        Specified by:
        productElement in interface scala.Product
      • productIterator

        public scala.collection.Iterator<java.lang.Object> productIterator()
        Specified by:
        productIterator in interface scala.Product
      • canEqual

        public boolean canEqual​(java.lang.Object x$1)
        Specified by:
        canEqual in interface scala.Equals
      • productElementName

        public java.lang.String productElementName​(int x$1)
        Specified by:
        productElementName in interface scala.Product
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object x$1)
        Specified by:
        equals in interface scala.Equals
        Overrides:
        equals in class java.lang.Object