Interface SceneInputPort<T>

Type Parameters:
T - message type defined by the optional adapter
All Superinterfaces:
AutoCloseable

public interface SceneInputPort<T> extends AutoCloseable
Optional source of scene-control messages supplied by an external adapter.

Implementations may receive data on their own threads. The receiver supplied by start(Consumer) is thread-safe and defers scene handling to a Processing frame boundary. Starting and closing an adapter must return promptly.

Adapters implement lifecycle, but ScenePorts owns it after connection; scenes must not close a connected port directly.

API stability: Advanced Stable.

Since:
2.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Stops the adapter and releases its external resources promptly.
    void
    start(Consumer<? super T> receiver)
    Starts publishing messages to the supplied activation receiver.
  • Method Details

    • start

      void start(Consumer<? super T> receiver)
      Starts publishing messages to the supplied activation receiver.
      Parameters:
      receiver - thread-safe receiver bound to the current scene activation
    • close

      void close()
      Stops the adapter and releases its external resources promptly. Implementations should make repeated calls harmless.
      Specified by:
      close in interface AutoCloseable