refactor: implement all core services

This commit is contained in:
2025-09-13 12:59:37 +02:00
parent 995d973011
commit 00aff9df3e
19 changed files with 987 additions and 718 deletions

View File

@@ -7,6 +7,12 @@
#include "ApiServer.h"
#include "TaskManager.h"
// Services
#include "NodeService.h"
#include "NetworkService.h"
#include "ClusterService.h"
#include "TaskService.h"
using namespace std;
NodeContext ctx({
@@ -18,6 +24,12 @@ TaskManager taskManager(ctx);
ClusterManager cluster(ctx, taskManager);
ApiServer apiServer(ctx, taskManager, ctx.config.api_server_port);
// Create services
NodeService nodeService(ctx);
NetworkService networkService(network);
ClusterService clusterService(ctx);
TaskService taskService(taskManager);
void setup() {
Serial.begin(115200);
@@ -27,7 +39,11 @@ void setup() {
// Initialize and start all tasks
taskManager.initialize();
// Start the API server
// Register services and start API server
apiServer.addService(nodeService);
apiServer.addService(networkService);
apiServer.addService(clusterService);
apiServer.addService(taskService);
apiServer.begin();
// Print initial task status