SynthesisHandle typedef

SynthesisHandle = ({bool Function(Cell cell) add, void Function(Iterable<Cell> cells) addAll, SynthesisCell cell, bool Function() clear, bool Function() isEmpty, bool Function(Cell cell) remove, void Function(Iterable<Cell> cells) removeAll, void Function() start, void Function() stop, List<Cell> Function() toList})

An Administrative Record providing a control interface for dynamic SynthesisCell topographies.

SynthesisHandle encapsulates the operational logic required to modify a convergent graph at runtime, allowing developers to add or remove upstream Cell sources without destroying the aggregator node.

Example:

final handle = SynthesisCell.handle([initialCell]);

// Dynamically add a new source
handle.add(networkCell);

// Temporarily pause aggregation
handle.stop();

// Resume later
handle.start();

// Access the underlying cell to observe it
handle.cell.observe((p) => print('Converged Pulse: ${p.payload}'));

See Also:

  • SynthesisCell: The node type managed by this handle.
  • Synapses: The underlying mechanism used to link and unlink cells.

Implementation

typedef SynthesisHandle = ({
  /// The underlying [SynthesisCell] node managed by this handle.
  SynthesisCell cell,

  /// Registers a new source cell into the synthesis aggregation.
  bool Function(Cell cell) add,

  /// De-registers a source cell and severs its topological link.
  bool Function(Cell cell) remove,

  /// Performs a batch registration of multiple source cells.
  void Function(Iterable<Cell> cells) addAll,

  /// Performs a batch de-registration of multiple source cells.
  void Function(Iterable<Cell> cells) removeAll,

  /// Returns a point-in-time snapshot of all registered source cells.
  List<Cell> Function() toList,

  /// Severs all links and empties the source cell collection.
  bool Function() clear,

  /// Indicates if the aggregator currently has zero registered sources.
  bool Function() isEmpty,

  /// Disconnects all sources while retaining the internal membership list.
  void Function() stop,

  /// Re-establishes reactive links for all members in the current list.
  void Function() start,
});