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

Abstract executor interface — schedules a callable to run "somewhere". More...

#include <executor.hpp>

Inheritance diagram for aria::async::IExecutor:
[legend]

Public Member Functions

 ~IExecutor () override=default
virtual void post (std::function< void()> fn)=0
 Legacy / canonical executor entry point.
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.
virtual bool is_main_thread () const noexcept
 True iff the calling thread is the scheduler's "main" thread.

Detailed Description

Abstract executor interface — schedules a callable to run "somewhere".

Inherits virtually from aria::IScheduler so that role/capability introspection is uniform across all schedulers in the framework (executors, dispatchers, timers). The legacy two-bool capability surface (is_safe_graph_executor() / is_safe_worker_executor()) is preserved as thin views over caps() so existing IExecutor subclasses keep compiling unchanged; a built-in executor that wants to override capabilities should prefer overriding caps().

The default capability set is Post | GraphSafe | WorkerSafe, matching the historical "permissive" defaults. Specific built-in executors override caps() to drop a flag they cannot uphold (e.g. ThreadPoolExecutor drops GraphSafe).

Constructor & Destructor Documentation

◆ ~IExecutor()

aria::async::IExecutor::~IExecutor ( )
overridedefault

Member Function Documentation

◆ post()

virtual void aria::async::IExecutor::post ( std::function< void()> fn)
pure virtual

Legacy / canonical executor entry point.

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

Implemented in aria::async::InlineExecutor, aria::async::MainThreadExecutor, aria::async::ThreadPoolExecutor, aria::async::VirtualTimeExecutor, and aria::runtime::DispatcherExecutor.

◆ caps()

aria::SchedulerCaps aria::async::IExecutor::caps ( ) const
inlinenodiscardoverridevirtualnoexcept

Capability bitmask.

Implementations should return a constant value (or at least a value stable across the object's lifetime).

Implements aria::IScheduler.

Reimplemented in aria::async::InlineExecutor, aria::async::MainThreadExecutor, aria::async::ThreadPoolExecutor, and aria::async::VirtualTimeExecutor.

◆ schedule()

void aria::async::IExecutor::schedule ( std::function< void()> fn)
inlineoverridevirtual

Submit fn for execution "soon". Defines Caps::Post.

Implements aria::IScheduler.

Reimplemented in aria::async::VirtualTimeExecutor.

◆ is_safe_graph_executor()

virtual bool aria::async::IExecutor::is_safe_graph_executor ( ) const
inlinenodiscardvirtualnoexcept

True iff this executor is safe to use as the graph-thread (UI) executor.

Reads caps(); override caps() in subclasses, not this method, unless you are a third-party implementation migrating gradually.

◆ is_safe_worker_executor()

virtual bool aria::async::IExecutor::is_safe_worker_executor ( ) const
inlinenodiscardvirtualnoexcept

True iff this executor can host worker tasks.

Reads caps(); override caps() in subclasses.


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