Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
Loading...
Searching...
No Matches
aria::runtime::DispatcherExecutor Class Referencefinal

IExecutor forwarding post() to a runtime::IDispatcher. More...

#include <dispatcher_executor.hpp>

Inheritance diagram for aria::runtime::DispatcherExecutor:
[legend]

Public Member Functions

 DispatcherExecutor (IDispatcher &d) noexcept
void post (std::function< void()> fn) override
 Legacy / canonical executor entry point.
aria::SchedulerCaps caps () const noexcept override
 Dispatcher-backed executor: safe as graph executor (main-thread affinity), safe as worker (posts land on the main thread), main-thread + pumpable characteristics inherited from the underlying dispatcher.
bool is_main_thread () const noexcept override
 True iff the calling thread is the scheduler's "main" thread.
Public Member Functions inherited from aria::async::IExecutor
 ~IExecutor () override=default
aria::SchedulerCaps caps () const noexcept override
 Capability bitmask.
void schedule (std::function< void()> fn) override
 Submit fn for execution "soon". Defines Caps::Post.
virtual bool is_safe_graph_executor () const noexcept
 True iff this executor is safe to use as the graph-thread (UI) executor.
virtual bool is_safe_worker_executor () const noexcept
 True iff this executor can host worker tasks.
Public Member Functions inherited from aria::IScheduler
virtual ~IScheduler ()=default
virtual void schedule_after (std::chrono::milliseconds delay, std::function< void()> fn)
 Submit fn for execution after delay.

Detailed Description

IExecutor forwarding post() to a runtime::IDispatcher.

Use case: UI executor for AsyncCommand — ensures coroutine resumption happens on the main thread after the worker finishes.

Constructor & Destructor Documentation

◆ DispatcherExecutor()

aria::runtime::DispatcherExecutor::DispatcherExecutor ( IDispatcher & d)
inlineexplicitnoexcept

Member Function Documentation

◆ post()

void aria::runtime::DispatcherExecutor::post ( std::function< void()> fn)
inlineoverridevirtual

Legacy / canonical executor entry point.

Implementations override this; the unified IScheduler::schedule(fn) is wired to it.

Implements aria::async::IExecutor.

◆ caps()

aria::SchedulerCaps aria::runtime::DispatcherExecutor::caps ( ) const
inlinenodiscardoverridevirtualnoexcept

Dispatcher-backed executor: safe as graph executor (main-thread affinity), safe as worker (posts land on the main thread), main-thread + pumpable characteristics inherited from the underlying dispatcher.

Implements aria::IScheduler.

◆ is_main_thread()

bool aria::runtime::DispatcherExecutor::is_main_thread ( ) const
inlinenodiscardoverridevirtualnoexcept

True iff the calling thread is the scheduler's "main" thread.

Default returns false; implementations advertising Caps::MainThread SHOULD override with a meaningful answer.

Reimplemented from aria::IScheduler.


The documentation for this class was generated from the following file: