|
VLink 2.0.0
A high-performance communication middleware
|
RAII task scheduling wrapper with delay, priority, timeouts and result chaining. 更多...
#include <atomic>#include <cstdint>#include <functional>#include <memory>#include <mutex>#include <vector>#include "./macros.h"类 | |
| struct | vlink::Schedule |
| Non-constructible utility struct providing task scheduling primitives. 更多... | |
| struct | vlink::Schedule::Config |
Scheduling parameters for a task posted via MessageLoop::exec_task(). 更多... | |
| class | vlink::Schedule::Status |
RAII handle returned by exec_task() for a void-callback task. 更多... | |
| struct | vlink::Schedule::Status::StatusImpl |
| class | vlink::Schedule::RetStatus |
RAII handle returned by exec_task() for a bool-returning callback task. 更多... | |
命名空间 | |
| namespace | vlink |
RAII task scheduling wrapper with delay, priority, timeouts and result chaining.
Schedule is a utility namespace (implemented as a non-constructible struct) that wraps a callable in a Config envelope and produces a Status or RetStatus RAII handle. The handle lets callers register continuation callbacks in a fluent style:
Config fields:
| Field | Meaning |
|---|---|
delay_ms | Delay before the task is posted (via one-shot Timer) |
priority | Task dispatch priority (for kPriorityType loop) |
schedule_timeout_ms | If the task is not started within this time, fire the timeout |
execution_timeout_ms | If the task runs longer than this, fire the timeout callback |
Status is move-only; copying is disabled. The internal state is reference-counted via std::shared_ptr<StatusImpl>, so it is safe to return by value.RetStatus adds on_then (fires when callback returns true) and on_else (fires when callback returns false).MessageLoop thread.