core beginner

Signal Routing Agent

Interactive Jido example showing how signal type routing maps into actions and executes through AgentServer.call/2 and AgentServer.cast/2.

signals routing agent-server core-mechanics l1

Related guides and notebooks

What you’ll learn

  • How signal_routes/1 maps signal types to action modules.
  • How AgentServer.call/2 handles request/response style updates.
  • How AgentServer.cast/2 queues async routing while state converges.
  • How to inspect execution history with before/after state snapshots.

How signal routing works

The SignalRoutingAgent declares three routes:

  • "increment"IncrementAction
  • "set_name"SetNameAction
  • "record_event"RecordEventAction

Each route is validated by the action schema and then applied to immutable agent state. The LiveView keeps a running view of counter, name, and recorded events so you can inspect behavior after every signal.

call vs cast behavior

  • call executes synchronously and returns the updated agent immediately.
  • cast enqueues signals asynchronously and returns :ok immediately.

In this demo:

  1. call controls let you increment, set name, and record typed events.
  2. cast burst sends 1..N increment signals and then shows converged state.
  3. The execution log captures mode, signal type, payload, and before/after state.