interplane-mv
INTERPLANE: open interoperability protocol between AI models and agent runtimes. Models express intent. Runtimes retain authority.
Brought by drakestapleton
interplane-mv / docs / external / nightdriver / 666 / harness / stubs / modern / itaskservice.h
| 1 | // Host stub: minimal ITaskService surface used by SocketServer. Not NightDriverStrip code. |
| 2 | #pragma once |
| 3 | #include "globals.h" |
| 4 | #include <atomic> |
| 5 | struct IService { virtual ~IService() = default; virtual const char* Name() const = 0; }; |
| 6 | class ITaskService : public IService |
| 7 | { |
| 8 | public: |
| 9 | bool Start() { return true; } |
| 10 | void Stop() { _shutdownRequested = true; } |
| 11 | protected: |
| 12 | struct TaskConfig { const char* taskName; size_t stackSize; int priority; int core; uint32_t shutdownTimeoutMs; }; |
| 13 | virtual TaskConfig GetTaskConfig() const = 0; |
| 14 | virtual void Run() = 0; |
| 15 | virtual void OnBeforeWaitForStop() {} |
| 16 | bool ShouldShutdown() const { return _shutdownRequested.load(); } |
| 17 | std::atomic<bool> _shutdownRequested{false}; |
| 18 | }; |