Interface Streamlet<I,​O>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void bindInput​(String key, Outlet<? extends I> input)
      Connects the Inlet of this Streamlet, identified by the given key, to the input from which the Inlet should acquire its state.
      void disconnectInputs()
      Disconnects all Inlets dominated by this Streamlet in the dataflow dependency graph.
      void disconnectOutputs()
      Disconnects all Inletss dominated by this Streamlet in the dataflow graph.
      Inlet<I> inlet​(String key)
      Returns the Inlet to this Streamlet identified by the given key; returns null if this Streamlet has no such Inlet.
      void invalidate()
      Marks this Streamlet—and all of its outlets—as having stale state.
      Outlet<O> outlet​(String key)
      Returns the Outlet of this Streamlet identified by the given key; returns null if this Streamlet has no such Outlet.
      void reconcile​(int version)
      Reconciles the state of this Streamlet, if the version of this Streamlet's state differs from the target version.
      void setStreamletContext​(StreamletContext context)
      Sets the environment in which this Streamlet operates.
      void setStreamletScope​(StreamletScope<? extends O> scope)
      Sets the lexically scoped parent of this Streamlet.
      StreamletContext streamletContext()
      Returns the environment in which this Streamlet operates.
      StreamletScope<? extends O> streamletScope()
      Returns the lexically scoped parent of this Streamlet.
      void unbindInput​(String key)
      Disconnects the Inlet of this Streamlet, identified by the given key, from its input Outlet, if connected.
    • Method Detail

      • streamletScope

        StreamletScope<? extends O> streamletScope()
        Returns the lexically scoped parent of this Streamlet. Returns null if this Streamlet has no lexical parent.
        Specified by:
        streamletScope in interface StreamletScope<I>
      • setStreamletScope

        void setStreamletScope​(StreamletScope<? extends O> scope)
        Sets the lexically scoped parent of this Streamlet.
      • setStreamletContext

        void setStreamletContext​(StreamletContext context)
        Sets the environment in which this Streamlet operates.
      • inlet

        Inlet<I> inlet​(String key)
        Returns the Inlet to this Streamlet identified by the given key; returns null if this Streamlet has no such Inlet.
      • bindInput

        void bindInput​(String key,
                       Outlet<? extends I> input)
        Connects the Inlet of this Streamlet, identified by the given key, to the input from which the Inlet should acquire its state. Delegates to Inlet.bindInput(Outlet) on the identified Inlet.
        Throws:
        IllegalArgumentException - if this Streamlet has no Inlet with the given key.
      • unbindInput

        void unbindInput​(String key)
        Disconnects the Inlet of this Streamlet, identified by the given key, from its input Outlet, if connected. Delegates to Inlet.unbindInput() on the identified Inlet.
        Throws:
        IllegalArgumentException - if this Streamlet has no Inlet with the given key.
      • outlet

        Outlet<O> outlet​(String key)
        Returns the Outlet of this Streamlet identified by the given key; returns null if this Streamlet has no such Outlet.
        Specified by:
        outlet in interface StreamletScope<I>
      • disconnectInputs

        void disconnectInputs()
        Disconnects all Inlets dominated by this Streamlet in the dataflow dependency graph. Used to recursively clean up chains of combinators terminating at this Streamlet.
      • disconnectOutputs

        void disconnectOutputs()
        Disconnects all Inletss dominated by this Streamlet in the dataflow graph. Used to recursively clean up chains of combinators originating from this Streamlet.
      • invalidate

        void invalidate()
        Marks this Streamlet—and all of its outlets—as having stale state. Invalidating a Streamlet will recursively invalidate all streamlets that transitively depend on the state of this Streamlet. Invalidating a Streamlet does not cause its state to be recomputed. A subsequent reconcile(int) call will reconcile the state of the Streamlet.
      • reconcile

        void reconcile​(int version)
        Reconciles the state of this Streamlet, if the version of this Streamlet's state differs from the target version. To reconcile its state, the Streamlet first invokes Inlet.reconcileOutput(int) on each of its inlets, to ensure that its input states are up-to-date. It then recomputes its own state, in an implementation defined manner. Finally, it invokes Outlet.reconcileInput(int) on its outlets, causing all transitively dependent streamlets to reconcile their own state.