A system for managing reactive connections between Cell instances.
Synapses manages connections between Cell objects in the reactive framework, enabling signal propagation across a network of reactive components. It handles both synchronous and asynchronous communication while ensuring proper validation through TestObject.
--** Core Features **--
Signal Propagation: Propagates signals from one Cell to linked cells Dynamic Linking/Unlinking: Cells can be connected link/disconnected unlink at runtime Validation Support: Checks TestObject rules before propagation Thread-Safe Async: Supports async operations via Synapses.async() Bidirectional: Control Can be enabled/disabled Synapses.enabled/Synapses.disabled Error Handling: Gracefully handle errors during signal processing
Example:
final cell1 = Cell();
final cell2 = Cell(synapses: Synapses([cell1])); // cell2 links to cell1
Constructors
-
Synapses.new([Iterable<
L> ? links]) -
Factory constructor for creating synapses with optional initial links.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
async(
covariant S signal, {Set< Cell> ? notified}) → Future<void> - Asynchronously propagates a signal through all linked cells.
-
call(
covariant S signal, {Set< Cell> ? notified}) → void - Propagates a signal through all linked cells.
-
link(
L link, {required Cell host}) → bool - Establishes a new connection from host to target cell.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
unlink(
L link) → bool - Removes a link to another cell.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited