esphome-api-client 0.5.0
Modern C++17 client for the ESPHome native API (plaintext + Noise)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
esphome::api::Executor Class Referenceabstract

Minimal executor: deferred execution plus one-shot timers. More...

#include <executor.hpp>

Public Member Functions

virtual ~Executor ()=default
 
virtual void post (std::function< void()> fn)=0
 Run fn soon, on the executor (never inline / re-entrantly).
 
virtual TimerId schedule_after (std::chrono::milliseconds delay, std::function< void()> fn)=0
 Run fn once after delay. Returns a handle usable with cancel.
 
virtual void cancel (TimerId id)=0
 Cancel a pending timer (no-op if it already fired or was cancelled).
 

Detailed Description

Minimal executor: deferred execution plus one-shot timers.

Everything the connection does is funnelled through here so it can run on a real io_context, a strand, or a deterministic test clock.

Constructor & Destructor Documentation

◆ ~Executor()

virtual esphome::api::Executor::~Executor ( )
virtualdefault

Member Function Documentation

◆ cancel()

virtual void esphome::api::Executor::cancel ( TimerId  id)
pure virtual

Cancel a pending timer (no-op if it already fired or was cancelled).

◆ post()

virtual void esphome::api::Executor::post ( std::function< void()>  fn)
pure virtual

Run fn soon, on the executor (never inline / re-entrantly).

◆ schedule_after()

virtual TimerId esphome::api::Executor::schedule_after ( std::chrono::milliseconds  delay,
std::function< void()>  fn 
)
pure virtual

Run fn once after delay. Returns a handle usable with cancel.


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