|
VLink
2.0.0
A high-performance communication middleware
|
Fluent task-scheduling wrapper used by MessageLoop::exec_task() and family.
More...
#include <atomic>#include <cstdint>#include <memory>#include <mutex>#include <vector>#include "./functional.h"#include "./macros.h"Go to the source code of this file.
Classes | |
| struct | vlink::Schedule |
Non-instantiable container for task-scheduling types and the process() entry points. More... | |
| struct | vlink::Schedule::Config |
Scheduling parameters captured at the call to exec_task(). More... | |
| class | vlink::Schedule::Status |
RAII handle returned by exec_task() when the wrapped callback returns void. More... | |
| struct | vlink::Schedule::Status::Impl |
| class | vlink::Schedule::RetStatus |
RAII handle returned by exec_task() when the wrapped callback returns bool. More... | |
Namespaces | |
| vlink | |
Fluent task-scheduling wrapper used by MessageLoop::exec_task() and family.
vlink::Schedule is a non-instantiable utility struct that wraps a user callable in a Config envelope and produces a Status (or RetStatus for bool-returning callbacks) RAII handle. The handle lets callers attach continuation callbacks in a fluent style, including success/failure branches, exception handling, and scheduling/execution timeout hooks.
Categories of options carried by Schedule::Config:
| Field | Purpose |
|---|---|
delay_ms | Wait before posting via a one-shot Timer. |
priority | Dispatch priority for priority-aware message loops. |
schedule_timeout_ms | Maximum queue-wait budget after the delay. Triggered once when the |
| task is dequeued. Drops the task on expiry. | |
execution_timeout_ms | Maximum execution budget per callback in the chain. Reported once |
| after each callback returns; never interrupts a running callback. |
Status surface exposed to the caller:
* exec_task() -> Status / RetStatus * +--> on_schedule_timeout(cb) * +--> on_execution_timeout(cb) * +--> on_catch(cb) * +--> [RetStatus] on_then(cb) * +--> [RetStatus] on_else(cb) *
Status is move-only and may be returned by value while it is being configured.dispatch() to post the task immediately; otherwise it is posted only when the stored handle is destroyed.