← Lattice
Lattice · How messages travel

Lattice: The messenger. Carries news between every part so nothing is missed.

Lattice delivers every message in order and drops a slow listener instead of letting it hold everyone up.

Read Lattice’s page →

How it goes, step by step
  1. 01A daemon module calls bus.publish(event_type, data)
  2. 02A memory-only type skips the log; any other type is numbered and written to event_log
  3. 03The event fans out to each matching subscriber queue; a full queue drops its oldest and the stream re-reads the log
  4. 04SSE clients on /api/events get frames whose id is the bus number
  5. 05Grant, Hank and the daemon each get their emitter from emitter_for(service)
  6. 06Until the ops bootstrap runs, each emitter holds its events (at most 256, oldest dropped)
  7. 07bootstrap_ops_emitter binds every handle to the daemon's MQTT client and instance
  8. 08Held events publish in emit order with their original ts and the bound instance; later events publish at emit time
  9. 09With no running event loop at the bind, held events are logged and not sent
  10. 10Each ops event goes out on kv/ops/events/<instance>/<service>/<event_type>
  11. 11bus_stream_api serves the local MxBus to peers on /api/bus/stream; bus_aggregator, which would pull peers in, is started by nothing
Production detail

The full production diagram — every part, sample message and watched file — is kept in the team library, reachable only from inside the private network.

Open the production diagram →

Every page here is rebuilt automatically when the thing it describes changes, so what you read is what is true today.