ZeroTierOne/controller/NotificationListener.hpp
Grant Limberg 95224379aa Refactor Redis & Posgres notification listeners into listener subclass in new CentralDB class
This allows us to interchangeably use different listeners (pgsql, redis, pubsub) depending on configuration values passed into the constructor.
2025-08-20 17:04:28 -07:00

32 lines
No EOL
696 B
C++

#ifndef NOTIFICATION_LISTENER_HPP
#define NOTIFICATION_LISTENER_HPP
#include <string>
namespace ZeroTier {
/**
* Base class for notification listeners
*
* This class is used to receive notifications from various sources such as Redis, PostgreSQL, etc.
*/
class NotificationListener {
public:
NotificationListener() = default;
virtual ~NotificationListener()
{
}
/**
* Called when a notification is received.
*
* Payload should be parsed and passed to the database handler's save method.
*
* @param payload The payload of the notification.
*/
virtual void onNotification(const std::string& payload) = 0;
};
} // namespace ZeroTier
#endif // NOTIFICATION_LISTENER_HPP