basic functionality
This commit is contained in:
26
src/ClusterManager.h
Normal file
26
src/ClusterManager.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
#include "Globals.h"
|
||||
#include "ClusterContext.h"
|
||||
#include "NodeInfo.h"
|
||||
#include <Arduino.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <ArduinoJson.h>
|
||||
#include <ESP8266HTTPClient.h>
|
||||
|
||||
class ClusterManager {
|
||||
public:
|
||||
ClusterManager(ClusterContext& ctx);
|
||||
void sendDiscovery();
|
||||
void listenForDiscovery();
|
||||
void addOrUpdateNode(const String& nodeHost, IPAddress nodeIP);
|
||||
void updateAllNodeStatuses();
|
||||
void removeDeadNodes();
|
||||
void printMemberList();
|
||||
const std::vector<NodeInfo>& getMemberList() const { return *ctx.memberList; }
|
||||
void fetchNodeInfo(const IPAddress& ip);
|
||||
void updateLocalNodeResources();
|
||||
void heartbeatTaskCallback();
|
||||
void updateAllMembersInfoTaskCallback();
|
||||
private:
|
||||
ClusterContext& ctx;
|
||||
};
|
||||
Reference in New Issue
Block a user