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 decohere()
      Marks this Streamlet—and all of its outlets—as having inconsistent 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.
      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 recohere​(int version)
      Updates the state of this Streamlet to make it consistent with 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.
      • decohere

        void decohere()
        Marks this Streamlet—and all of its outlets—as having inconsistent state. Decohering a Streamlet will recursively decohere all streamlets that transitively depend on the state of this Streamlet. Decohering a Streamlet does not cause its state to be recomputed. A subsequent recohere(int) call will eventually make the state of the Streamlet coherent again.
      • recohere

        void recohere​(int version)
        Updates the state of this Streamlet to make it consistent with the target version. The Streamlet only needs to update if its current version differs from the target version. To update its state, the Streamlet first invokes Inlet.recohereOutput(int) on each of its inlets, to ensure that its input states are coherent. It then recomputes its own state in an implementation defined manner. Finally, it invokes Outlet.recohereInput(int) on its outlets, causing all transitively dependent streamlets to make their own states coherent again.