|
VLink 2.0.0
A high-performance communication middleware
|
RAII handle returned by exec_task() for a void-callback task.
更多...
#include <schedule.h>
类 | |
| struct | StatusImpl |
Public 成员函数 | |
| Status () | |
Constructs an invalid Status (not yet associated with a task). | |
| ~Status () | |
| Destructor. | |
| Status (const Status &)=delete | |
| Status & | operator= (const Status &)=delete |
| Status (Status &&status) noexcept | |
| Move constructor. | |
| Status & | operator= (Status &&status) noexcept |
| Move assignment. | |
| void | set_valid (bool valid) |
| Sets whether the status is valid (task was successfully posted). | |
| bool | is_valid () const |
Returns true if the associated task was posted successfully. | |
| Status & | on_schedule_timeout (Callback &&callback) |
Registers a callback fired when the task does not start within schedule_timeout_ms. | |
| Status & | on_execution_timeout (Callback &&callback) |
Registers a callback fired when the task runs longer than execution_timeout_ms. | |
| Status & | on_catch (CatchCallback &&callback) |
| Registers a callback fired when the task throws an exception. | |
Protected 属性 | |
| friend | Schedule |
| std::shared_ptr< StatusImpl > | impl_ |
RAII handle returned by exec_task() for a void-callback task.
Holds a shared reference to the internal task state. Destruction does not cancel the task. Callback registration methods return *this to allow chaining.
| vlink::Schedule::Status::Status | ( | ) |
| vlink::Schedule::Status::~Status | ( | ) |
Destructor.
|
delete |
|
noexcept |
Move constructor.
| status | Source status to move from. |
|
nodiscard |
Returns true if the associated task was posted successfully.
true if valid. | Status & vlink::Schedule::Status::on_catch | ( | CatchCallback && | callback | ) |
Registers a callback fired when the task throws an exception.
The exception is caught inside the wrapper and passed to this callback. The task is considered failed after an exception.
| callback | Callback invoked with the caught exception. |
*this for chaining. Registers a callback fired when the task runs longer than execution_timeout_ms.
| callback | Callback invoked from the loop thread on execution timeout. |
*this for chaining. Registers a callback fired when the task does not start within schedule_timeout_ms.
| callback | Callback invoked from the loop thread on schedule timeout. |
*this for chaining. Move assignment.
| status | Source status to move from. |
*this. | void vlink::Schedule::Status::set_valid | ( | bool | valid | ) |
Sets whether the status is valid (task was successfully posted).
| valid | true if the associated task was posted successfully. |
|
protected |
|
protected |