Loading...
Searching...
No Matches
NetworkManager.h
Go to the documentation of this file.
1// Copyright (c) 2025 Dave R. Smith.
2// Malena Framework — Licensed under PolyForm Noncommercial 1.0.0; commercial use requires a paid license. See LICENSE.
3
4#ifndef MALENA_NETWORKMANAGER_H
5#define MALENA_NETWORKMANAGER_H
6
7#pragma once
8
10#include <cstddef>
11#include <functional>
12
13namespace ml
14{
50 {
51 public:
52 NetworkManager() = delete;
55
56 // ── Lifecycle ─────────────────────────────────────────────────────────
57
67 static void initialize(std::size_t threadCount = 4);
68
76 static void shutdown();
77
78 // ── Frame integration ─────────────────────────────────────────────────
79
86 static void autoFlush();
87
94 static void flush();
95
96 // ── Internal ─────────────────────────────────────────────────────────
97
99
113 static void enqueue(std::function<void()> work,
114 std::function<void()> onComplete);
115
125 static void queueCallback(std::function<void()> callback);
126
128 };
129
130} // namespace ml
131
132#endif // MALENA_NETWORKMANAGER_H
NetworkManager & operator=(const NetworkManager &)=delete
static void shutdown()
Stop all worker threads and discard pending work.
static void flush()
Deliver all pending callbacks on the calling (main) thread.
static void autoFlush()
Register flush() with AppManager's pre-render hook.
static void initialize(std::size_t threadCount=4)
Start the background thread pool.
NetworkManager(const NetworkManager &)=delete
NetworkManager()=delete
#define MALENA_API
Definition Component.h:22