Agents won't start if initial mqtt won't connect (any secondaries?)

Agents (sensors/effectors) may need to do work before/without an mqtt-connection. The pattern should be more like:

  • Reading values triggers sending to some sink
  • sinks can be mqtt, logs, actions, etc
  • control of the sensor/effector can happen before mqtt is up. maybe independant, etc.
  • control/work happens independent of the mqtt. e.g. sources update state, and work checks the state. event-flags to trigger some work. periodic to trigger some work, etc.

E.g. The rgb-status wants to control the rgb-led, before mqtt is up. mqtt-messages update it later.

  • So, don't block at mqtt-connection open. queue it, and go to "work"
  • mqtt message handlers update event-flags/state/queues (combine event-flag/timers?)
  • a work loop looks at state (maybe blocking till state-change)
  • value changes send to sinks (which may be empty if mqtt isn't up yet). table of .value->mqtt-messages?
  • periodic work loop

Can I rewrite more generally: a reconnect pattern? I think I have it for secondaries

  • confirm that initial blocks
  • confirm that secondaries do/don't block
  • see notes in the FIXME issue #117
Edited by Alan Grover