Lightweight 0.20260617.0
Loading...
Searching...
No Matches
Lightweight::Async::IExecutor Class Referenceabstract

#include <Executor.hpp>

Inheritance diagram for Lightweight::Async::IExecutor:
Lightweight::Async::InlineExecutor Lightweight::Async::ManualExecutor Lightweight::Async::StrandExecutor Lightweight::Async::ThreadPoolExecutor

Public Member Functions

 IExecutor (IExecutor const &)=delete
 
IExecutoroperator= (IExecutor const &)=delete
 
 IExecutor (IExecutor &&)=delete
 
IExecutoroperator= (IExecutor &&)=delete
 
virtual void Post (Work work)=0
 

Detailed Description

Interface for an executor that runs posted work items.

Executors are injected (dependency injection) and owned by the caller; the async layer only ever holds references to them. Every implementation's Post is thread-safe.

Definition at line 21 of file Executor.hpp.

Member Function Documentation

◆ Post()

virtual void Lightweight::Async::IExecutor::Post ( Work  work)
pure virtual

Schedules work to run on the executor. Thread-safe.

Parameters
workThe work item to enqueue (consumed).

Implemented in Lightweight::Async::InlineExecutor, Lightweight::Async::ManualExecutor, Lightweight::Async::StrandExecutor, and Lightweight::Async::ThreadPoolExecutor.


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