signal_router (faber_neuroevolution v1.2.4)
View SourceSignal Router for Domain-to-Silo Communication.
Routes domain signals (emitted by domain_signals behaviour implementations) to the appropriate silos based on signal category.
Architecture
Domain signals flow from external applications to internal silos:
Domain App (swai-node, etc.) │ ├── domain_signals:emit_signals/2 │ ▼ signal_router:route/1 │ ├── ecological signals → ecological_silo ├── competitive signals → competitive_silo ├── cultural signals → cultural_silo └── ... (13 silo categories)
The router uses lc_cross_silo infrastructure to deliver signals, treating the domain as a special "domain" source silo.
Usage
Called by the evaluation loop after each evaluation:
Signals = DomainModule:emit_signals(DomainState, Metrics), signal_router:route(Signals).
Summary
Functions
Emit signals from domain state using the registered domain module.
Get the registered domain module.
Register the domain module implementing domain_signals behaviour.
Route a list of domain signals to their destination silos.
Route a single domain signal to its destination silo.
Functions
Emit signals from domain state using the registered domain module.
Convenience function that: 1. Gets the registered domain module 2. Calls emit_signals/2 on it 3. Routes the resulting signals
-spec get_domain_module() -> {ok, module()} | {error, not_registered}.
Get the registered domain module.
-spec register_domain_module(module()) -> ok.
Register the domain module implementing domain_signals behaviour.
Called during application startup to configure signal emission.
-spec route([domain_signals:signal()]) -> ok.
Route a list of domain signals to their destination silos.
Each signal is a tuple: {Category, Name, Value} Category determines which silo receives the signal.
-spec route_signal(domain_signals:signal()) -> ok.
Route a single domain signal to its destination silo.