Class ScenePorts
The core library knows only application-defined message values. Input is bounded and delivered on the Processing thread; output transport and backpressure remain adapter-owned. The default input queue retains at most 256 messages, drops the oldest on overflow, and invokes at most 32 handlers per frame.
Pause drops queued input and rejects new input until resume; it never replays stale device messages. Activation disposal closes connected adapters in reverse registration order.
API stability: Advanced Stable.
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescription<T> voidconnectInput(SceneInputPort<T> port, Consumer<? super T> handler) Connects one external source to a handler owned by this scene activation.<T> SceneOutputPort<T>connectOutput(SceneOutputPort<T> port) Connects a non-blocking output adapter and returns an activation-guarded view of it.longint
-
Method Details
-
connectInput
Connects one external source to a handler owned by this scene activation.When the bounded queue is full, the oldest pending message is discarded so the activation can continue receiving current device state. The adapter may publish from any thread; the scene handler never runs on that producer thread.
- Type Parameters:
T- message type defined by the adapter- Parameters:
port- external input adapter owned by this activation after connectionhandler- scene handler invoked at a Processing frame boundary
-
connectOutput
Connects a non-blocking output adapter and returns an activation-guarded view of it.After pause or disposal, the managed view returns
falsewithout forwarding the value. The runtime retains ownership of the connected adapter'sAutoCloseablelifecycle.- Type Parameters:
T- message type defined by the adapter- Parameters:
port- external output adapter owned by this activation after connection- Returns:
- activation-guarded output port
-
getDroppedInputCount
public long getDroppedInputCount()- Returns:
- cumulative number of oldest pending messages discarded due to queue pressure
-
getPendingInputCount
public int getPendingInputCount()- Returns:
- number of input messages waiting for a future frame boundary
-