|
VLink
2.0.0
A high-performance communication middleware
|
RAII handle returned by exec_task() when the wrapped callback returns bool.
More...
#include <schedule.h>
Public Member Functions | |
| Status & | on_else (Callback &&callback) |
Installs the callback fired when the wrapped task returns false. More... | |
| RetStatus & | on_then (RetCallback &&callback) |
Appends a continuation that runs only when the previous callback returned true. More... | |
| Status () | |
| Constructs a fresh handle backed by a newly allocated task state. More... | |
| Status (const Status &)=delete | |
| Status (Status &&status) noexcept | |
Move-constructs from status, transferring its task state. More... | |
Public Member Functions inherited from vlink::Schedule::Status | |
| Status () | |
| Constructs a fresh handle backed by a newly allocated task state. More... | |
| ~Status () | |
| Destroys the handle reference, committing the configuration so the task may dispatch. More... | |
| Status (const Status &)=delete | |
| Status & | operator= (const Status &)=delete |
| Status (Status &&status) noexcept | |
Move-constructs from status, transferring its task state. More... | |
| Status & | operator= (Status &&status) noexcept |
Move-assigns from status, transferring its task state. More... | |
| void | set_valid (bool valid) |
| Marks whether the handle's underlying task was successfully posted. More... | |
| bool | is_valid () const |
| Reports whether the wrapped task was successfully posted. More... | |
| bool | dispatch () |
| Commits the configuration immediately and reports whether the task was posted. More... | |
| Status & | on_schedule_timeout (Callback &&callback) |
| Installs the callback fired when the task missed its scheduling deadline. More... | |
| Status & | on_execution_timeout (Callback &&callback) |
Installs the callback fired when a chained callback exceeds execution_timeout_ms. More... | |
| Status & | on_catch (CatchCallback &&callback) |
Installs the callback fired when the task throws a std::exception. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from vlink::Schedule::Status | |
| void | commit () noexcept |
| Runs the installed launcher exactly once, posting the wrapped task to its dispatcher. More... | |
Protected Attributes inherited from vlink::Schedule::Status | |
| friend | Schedule |
| friend | MessageLoop |
| std::shared_ptr< Impl > | impl_ |
| Callback | launcher_ |
| bool | committed_ {false} |
RAII handle returned by exec_task() when the wrapped callback returns bool.
Extends Status with the on_then chain and the on_else fallback so callers can express success/failure branches inline.
Installs the callback fired when the wrapped task returns false.
Only one else callback may be registered; late registrations are dropped.
| callback | Hook invoked on the dispatcher thread when false is returned. |
Status for further chaining. | RetStatus& vlink::Schedule::RetStatus::on_then | ( | RetCallback && | callback | ) |
Appends a continuation that runs only when the previous callback returned true.
Multiple on_then callbacks may be chained. Each is invoked in registration order until one returns false, at which point the chain stops and the registered on_else (if any) fires.
| callback | Continuation taking no arguments and returning bool. |
*this for further chaining. | vlink::Schedule::Status::Status |
Constructs a fresh handle backed by a newly allocated task state.
|
delete |
|
noexcept |
Move-constructs from status, transferring its task state.
| status | Source handle to move from. |