mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-02 19:13:44 +00:00
[traffic] Implement HttpTraffSource
Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
@@ -399,7 +399,10 @@ Framework::Framework(FrameworkParams const & params, bool loadMaps)
|
||||
* MockTraffSource for debugging purposes.
|
||||
* TODO Replace with a real source, parametrized and conditionally loaded, once we have one.
|
||||
*/
|
||||
traffxml::MockTraffSource::Create(m_trafficManager);
|
||||
//traffxml::MockTraffSource::Create(m_trafficManager);
|
||||
|
||||
// For testing purposes, HttpTraffSource pointing to a hardcoded local instance
|
||||
traffxml::HttpTraffSource::Create(m_trafficManager, "http://traff:8080/subscription-manager");
|
||||
}
|
||||
|
||||
Framework::~Framework()
|
||||
|
||||
@@ -497,7 +497,8 @@ void TrafficManager::RegisterSource(std::unique_ptr<traffxml::TraffSource> sourc
|
||||
UniteActiveMwms(activeMwms);
|
||||
}
|
||||
|
||||
source->SubscribeOrChangeSubscription(activeMwms);
|
||||
if (!activeMwms.empty())
|
||||
source->SubscribeOrChangeSubscription(activeMwms);
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_trafficSourceMutex);
|
||||
@@ -699,7 +700,6 @@ void TrafficManager::ThreadRoutine()
|
||||
if (hasUpdates)
|
||||
OnTrafficDataUpdate();
|
||||
}
|
||||
// Calling Unsubscribe() from the worker thread on exit makes thread synchronization easier
|
||||
Unsubscribe();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user