ReceptorBase<C extends Cell> class abstract

The foundational base implementation of Receptor that provides the core synchronization and pulse propagation engine.

ReceptorBase manages the multi-stage pipeline, error handling, and coordination of signal propagation. It serves as the bridge between incoming stimuli and the cell's internal state.

When to use

Use ReceptorBase as the base class for specialized receptor implementations. You typically don't construct this directly; instead, use the Receptor factory or predefined singletons.

How it works

  1. Pipeline Management: It stores and coordinates the three stages (Sanitization, Core Logic, and Commitment).
  2. Context Binding: It manages the transition from a stateless template to an activated, cell-bound instance.
  3. Resilient Propagation: The call method validates the signal, runs the pipeline synchronously, and safely broadcasts results to synapses.
  4. Lifecycle Control: It handles the activation and cloning of logic blueprints across different cell instances.
  5. Governance: When governed, it applies architectural policies and forensic trace information.

Non‑obvious

  • Flyweight Architecture: It utilizes a record-based storage strategy to pack all pipeline instructions into a single memory block.
  • Traceability: Every propagation step is logged to the pulse's metadata, providing full forensic visibility for debugging.
  • Thread-Safe Context: Activation pins the receptor to a specific operational perimeter, ensuring state access is always consistent.
  • Synchronous Pipeline: The pipeline executes synchronously. For asynchronous execution, use ReceptorAsync.
  • Validation Async Support: While the pipeline is synchronous, validation can return a Future<bool> for asynchronous validation checks. This is the only async operation in the call path.

Type Parameters:

  • C: The type of the host Cell.
Implemented types

Constructors

ReceptorBase({Instruction<Cell, Pulse, Pulse>? instruction, Instruction<Cell, Pulse, Pulse>? preProcess, Instruction<Cell, Pulse, Pulse>? postProcess, Pulse? reaction(Pulse pulse, C host, {dynamic user})?, void init()?, dynamic user()?})
Initializes the foundational engine for pulse transformation and state governance.
ReceptorBase.fromRecord({Record record = ()})
A foundational constructor that initializes a ReceptorBase from a pre-compiled Record of configuration properties.

Properties

async ReceptorAsync<C>
Returns an asynchronous adapter for this receptor.
no setteroverride
cell ↔ C
The host cell this receptor is bound to.
latefinaloverride-getter
clone Receptor<C>
Returns a shallow, unactivated copy of the current Receptor.
no setterinherited
hashCode int
Hash code for this receptor.
no setteroverride
isActivated bool
Indicates whether this receptor is activated.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

activate(C cell) bool
Activates the receptor by binding it to a cell.
override
call(covariant Pulse incoming) FutureOr<Pulse?>
The internal execution entry point for signal propagation and transformation.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
Equality operator for receptors.
override

Static Methods

mask({Instruction<Cell, Pulse, Pulse>? instruction, Instruction<Cell, Pulse, Pulse>? preProcess, Instruction<Cell, Pulse, Pulse>? postProcess, Function? reaction, Function? user, Function? init}) Record
Creates a mask record for the receptor configuration.