mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-03 09:39:38 +00:00
Adds a way to register a drain-callback on the polar-data loading pipeline for a specific race without also triggering fresh ingestion of that race's fixes (which is what raceFinishedLoading does). The new method may be called any number of times, before or after raceFinishedLoading, and coordinates with it via a per-miner gate so a caller never accidentally registers a drain callback while the pipeline is momentarily idle before this race's fixes have entered it. PolarDataMiner now maintains: - callbacksWaitingForFixIngestion: parked callbacks for races whose fixes haven't been queued yet; - racesWithIngestedFixes: races whose fixes have been fully queued. raceFinishedLoading, after queueing all of a race's competitor fixes, promotes the race into racesWithIngestedFixes and registers all parked callbacks (plus the caller-supplied one, if any) on the drain. runWhenPolarLoadingFinishedFor either registers immediately (race already ingested) or parks the callback for later promotion. Removed the stale 'TODO bug6241:' comment atop raceFinishedLoading; the mechanism it sketched is now in place (loading pipeline + drain callback) so the TODO no longer applies. This method is the building block that the per-race installation primitive for the maneuver-based wind estimator (task 14) will compose with TrackedRace.runWhenPastLoading.