Port<TValue, TInputData extends Object?, THandler extends Function> class
abstract
Base class for composable ports (pipes, behaviors, slots).
Ports are stateless across containers. Handler registration,
deregistration, and invocation all go through per-container maps
owned by AppContainer (via container.handlersOf<THandler>(port),
container.addPortHandler(...), etc.). The only mutable field on a
port itself is _owner, which is set once (either up front via the
feature: constructor argument or lazily on the first apply) and
never cleared — the ownership of a port is a property of the feature
that declared it in ports:, stable for the lifetime of the process.
Handler invariants:
- Handlers must be pure — no side effects beyond computing
the returned value. A handler that throws will break the
current
applyand propagate the exception to the caller (the container's reaction doesn't swallow it). - Handlers can read from reactive
State/Atom; reads are tracked automatically for invalidation. They must NOT write to reactive state during a handler body — that creates a reaction cycle where the write invalidates the very reaction executing the handler. Schedule writes outside of the handler (e.g. in anonStartFuture or user-triggered task).
- Implemented types
- Implementers
Properties
-
debugInfo
→ Map<
String, String> -
Key-value pairs describing this object for debug output.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → PortType
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited