mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-09-09 16:22:54 +02:00
32 lines
No EOL
696 B
C++
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
|