Push live-state events through queued drain to Redis

This commit is contained in:
Audric committed 2026-04-15 09:25:07 +02:00
1 parent 8363e36f6a
commit 97467a4f70
2 files changed
+150 -10

No files matched your search

+28
View File
@@ -1081,6 +1081,10 @@ void Reflector::clientDisconnected(Async::FramedTcpConnection *con,
{
m_mqtt->onClientDisconnected(client->callsign());
}
if (m_redis != nullptr)
{
m_redis->clearLiveClient(client->callsign());
}
scheduleNodeListUpdate();
}
//Application::app().runTask([=]{ delete client; });
@@ -1546,6 +1550,10 @@ void Reflector::onTalkerUpdated(uint32_t tg, ReflectorClient* old_talker,
{
m_mqtt->onTalkerStop(tg, old_talker->callsign(), false);
}
if (m_redis != nullptr)
{
m_redis->clearLiveTalker(tg);
}
}
if (new_talker != 0)
{
@@ -1565,6 +1573,10 @@ void Reflector::onTalkerUpdated(uint32_t tg, ReflectorClient* old_talker,
{
m_mqtt->onTalkerStart(tg, new_talker->callsign(), false);
}
if (m_redis != nullptr)
{
m_redis->pushLiveTalker(tg, new_talker->callsign(), "local");
}
}
// In satellite mode, forward to parent instead of trunk peers
@@ -2682,6 +2694,10 @@ void Reflector::onTrunkTalkerUpdated(uint32_t tg,
{
m_mqtt->onTalkerStop(tg, old_cs, true);
}
if (m_redis != nullptr)
{
m_redis->clearLiveTalker(tg);
}
}
if (!new_cs.empty())
{
@@ -2696,6 +2712,10 @@ void Reflector::onTrunkTalkerUpdated(uint32_t tg,
{
m_mqtt->onTalkerStart(tg, new_cs, true);
}
if (m_redis != nullptr)
{
m_redis->pushLiveTalker(tg, new_cs, "trunk");
}
}
// Forward trunk talker events to connected satellites
@@ -2785,6 +2805,10 @@ void Reflector::onClientAuthenticated(const std::string& callsign,
{
m_mqtt->onClientConnected(callsign, tg, ip);
}
if (m_redis != nullptr)
{
m_redis->pushLiveClient(callsign, ip, "", tg);
}
scheduleNodeListUpdate();
} /* Reflector::onClientAuthenticated */
@@ -2851,6 +2875,10 @@ void Reflector::onTrunkStateChanged(const std::string& section,
m_mqtt->onTrunkDown(topic_id, direction);
}
}
if (m_redis != nullptr)
{
m_redis->pushLiveTrunk(section, up ? "up" : "down", peer_id);
}
} /* Reflector::onTrunkStateChanged */