langgoap.run_sensors_async#
- async run_sensors_async(sensors, world_state)[source]#
Run all sensors asynchronously and return (name, updates) pairs.
Falls back to
sense()in a thread executor for sensors that only implement the syncSensorprotocol. Exceptions from individual sensors are caught and logged so a single failing sensor never halts the rest.Execution order: sensors are awaited sequentially (one at a time). This is intentional — each sensor receives the cumulative
world_statethat includes all updates from sensors that ran before it, enabling dependent sensor chains (e.g. sensor B reads the value written by sensor A). If your sensors are fully independent and latency is critical, run them concurrently yourself withasyncio.gather()and merge the result dicts manually.- Parameters:
sensors (list[Sensor | AsyncSensor])
world_state (dict[str, Any])
- Return type:
list[tuple[str, dict[str, Any]]]