|
Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
|
Abstract main-thread dispatcher. More...
#include <dispatcher.hpp>
Public Member Functions | |
| ~IDispatcher () override=default | |
| virtual void | post (std::function< void()> fn)=0 |
| Schedule the callable to run on the main thread (asynchronously). | |
| virtual void | post_delayed (std::chrono::milliseconds delay, std::function< void()> fn)=0 |
| Like post(), but with a delay. | |
| bool | is_main_thread () const noexcept override=0 |
| Returns true if currently executing on the main thread. | |
| void | post_after (std::chrono::milliseconds delay, std::function< void()> fn) override |
| IDelayedScheduler adapter — routes to post_delayed. | |
| ::aria::SchedulerCaps | caps () const noexcept override |
| Capability bitmask. | |
| void | schedule (std::function< void()> fn) override |
| Submit fn for execution "soon". Defines Caps::Post. | |
| void | schedule_after (std::chrono::milliseconds delay, std::function< void()> fn) override |
| Submit fn for execution after delay. | |
| Public Member Functions inherited from aria::IDelayedScheduler | |
| ~IDelayedScheduler () override | |
| Public Member Functions inherited from aria::IScheduler | |
| virtual | ~IScheduler ()=default |
Abstract main-thread dispatcher.
Posts callables to be executed on the platform's main / UI thread. Concrete implementations exist for each platform (AppKit/UIKit/JNI/Qt/Emscripten), plus a generic in-process implementation for testing and console apps.
Inherits from IDelayedScheduler (and therefore from aria::IScheduler) so it can be used directly by debounce / throttle / retry_with_backoff / unified IScheduler consumers without an adapter.
Capability bitmask is Post | Delay | MainThread | Pumpable. Concrete platform dispatchers may widen it (e.g. by adding GraphSafe/WorkerSafe in caps() overrides) — by default we conservatively claim the four universal capabilities.
|
overridedefault |
|
pure virtual |
Schedule the callable to run on the main thread (asynchronously).
Implemented in aria::adapters::qt6::QtDispatcher, and aria::runtime::SimpleDispatcher.
|
pure virtual |
Like post(), but with a delay.
Implemented in aria::adapters::qt6::QtDispatcher, and aria::runtime::SimpleDispatcher.
|
nodiscardoverridepure virtualnoexcept |
Returns true if currently executing on the main thread.
Reimplemented from aria::IScheduler.
Implemented in aria::adapters::qt6::QtDispatcher, and aria::runtime::SimpleDispatcher.
|
inlineoverridevirtual |
IDelayedScheduler adapter — routes to post_delayed.
Implements aria::IDelayedScheduler.
|
inlinenodiscardoverridevirtualnoexcept |
Capability bitmask.
Implementations should return a constant value (or at least a value stable across the object's lifetime).
Reimplemented from aria::IDelayedScheduler.
Reimplemented in aria::adapters::qt6::QtDispatcher.
|
inlineoverridevirtual |
Submit fn for execution "soon". Defines Caps::Post.
Reimplemented from aria::IDelayedScheduler.
|
inlineoverridevirtual |
Submit fn for execution after delay.
Default implementation throws unsupported_capability; implementations that advertise Caps::Delay MUST override.
Reimplemented from aria::IDelayedScheduler.