Expand description
LDM maintenance — background garbage-collection and subscription firing.
LdmMaintenance::spawn starts a 1 Hz thread that:
- Removes expired records (past their
time_validity_swindow). - Removes records outside the local station’s maintenance area (using correct Haversine distance — fixes the Python Euclidean bug).
- Calls
LdmService::fire_subscriptionsto deliver periodic push notifications to all active subscribers.
The maintenance area centre can be updated dynamically via
AreaCenter::update, e.g. from GPS fixes, so the LDM always tracks
the local station’s current position.
The thread holds only Arc handles; it exits cleanly when all owners of
LdmService have been dropped (the Arc reference count reaches zero
and fire_subscriptions becomes a no-op on the last cycle before the
Arc upgrade returns None).
Structs§
- Area
Center - Thread-safe, dynamically updatable maintenance area centre.
- LdmMaintenance
- LDM maintenance controller.